Merge pull request #15949 from MarianoGnu/issue_15743

Prevent prompting unexpected errors on Bullet's RigidBody. Attemps to fix #15743
This commit is contained in:
Rémi Verschelde 2018-01-22 09:03:12 +01:00 committed by GitHub
commit aa9b1bd101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {