diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-03-18 23:28:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 23:28:42 -0700 |
commit | a53645e726097e9020d12df886b62431cb1740b9 (patch) | |
tree | dba29638f12d4db5ac61207a3213cbb0ead1b375 /scene | |
parent | a90a8eb34b0a368af928c3c1aebfdf8fb7211f72 (diff) | |
parent | 3f64215a430cb20a875a55e9dce0975449cf1400 (diff) |
Merge pull request #27205 from Kanabenki/set-friction-bounce-check
Add missing check for 2d physics bounce and friction setters
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; } |