diff options
author | Kanabenki <18357657+Kanabenki@users.noreply.github.com> | 2019-03-18 15:30:26 +0100 |
---|---|---|
committer | Kanabenki <18357657+Kanabenki@users.noreply.github.com> | 2019-03-18 15:30:26 +0100 |
commit | 3f64215a430cb20a875a55e9dce0975449cf1400 (patch) | |
tree | 99bdf620997908cd1eba596167be1dc7d10515c0 /scene | |
parent | df7d3708c5b535c3696943322a14ec19a175e30c (diff) |
Add missing check for 2d physics bounce and friction setters
The override check was already present for 3d physics but missing for 2d
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 1b7e1a6b8b..690f1d4b4a 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -199,7 +199,7 @@ real_t StaticBody2D::get_constant_angular_velocity() const { #ifndef DISABLE_DEPRECATED void StaticBody2D::set_friction(real_t p_friction) { - if (p_friction == 1.0) { // default value, don't create an override for that + if (p_friction == 1.0 && physics_material_override.is_null()) { // default value, don't create an override for that return; } @@ -229,7 +229,7 @@ real_t StaticBody2D::get_friction() const { void StaticBody2D::set_bounce(real_t p_bounce) { - if (p_bounce == 0.0) { // default value, don't create an override for that + if (p_bounce == 0.0 && physics_material_override.is_null()) { // default value, don't create an override for that return; } @@ -626,7 +626,7 @@ real_t RigidBody2D::get_weight() const { #ifndef DISABLE_DEPRECATED void RigidBody2D::set_friction(real_t p_friction) { - if (p_friction == 1.0) { // default value, don't create an override for that + if (p_friction == 1.0 && physics_material_override.is_null()) { // default value, don't create an override for that return; } @@ -655,7 +655,7 @@ real_t RigidBody2D::get_friction() const { void RigidBody2D::set_bounce(real_t p_bounce) { - if (p_bounce == 0.0) { // default value, don't create an override for that + if (p_bounce == 0.0 && physics_material_override.is_null()) { // default value, don't create an override for that return; } |