diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-01-22 09:03:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-22 09:03:12 +0100 |
commit | aa9b1bd101dfc17a03f8c2d7bd82f2dcc6d92203 (patch) | |
tree | 58fe093060c945783caf79d077939457578ba1af | |
parent | 3c5d11d6008c13f1eaad4aafdadc514cb3c8fe17 (diff) | |
parent | d0908565608b989f8ce4bae6cbe5572f26c8cebe (diff) |
Merge pull request #15949 from MarianoGnu/issue_15743
Prevent prompting unexpected errors on Bullet's RigidBody. Attemps to fix #15743
-rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 3edc407e87..96a53f9f8b 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -955,7 +955,8 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) { const bool isDynamic = p_mass != 0.f; if (isDynamic) { - ERR_FAIL_COND(PhysicsServer::BODY_MODE_RIGID != mode && PhysicsServer::BODY_MODE_CHARACTER != mode); + if (PhysicsServer::BODY_MODE_RIGID != mode && PhysicsServer::BODY_MODE_CHARACTER != mode) + return; m_isStatic = false; compoundShape->calculateLocalInertia(p_mass, localInertia); @@ -975,7 +976,8 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) { } } else { - ERR_FAIL_COND(PhysicsServer::BODY_MODE_STATIC != mode && PhysicsServer::BODY_MODE_KINEMATIC != mode); + if (PhysicsServer::BODY_MODE_STATIC != mode && PhysicsServer::BODY_MODE_KINEMATIC != mode) + return; m_isStatic = true; if (PhysicsServer::BODY_MODE_STATIC == mode) { |