Fix for [#33090] "Segfault/Crash with Empty and Motion Actuator, Keyboard Sensor" reported by Martin Felke (scorpion81).

Apparently, not all objects have physics controllers, so now we do a NULL check in KX_ObjectActuator.
This commit is contained in:
Mitchell Stokes 2012-11-05 15:13:54 +00:00
parent ea61c74262
commit b2f837896d

@ -117,7 +117,7 @@ bool KX_ObjectActuator::Update()
} }
// Explicitly stop the movement if we're using a character (apply movement is a little different for characters) // Explicitly stop the movement if we're using a character (apply movement is a little different for characters)
if (parent->GetPhysicsController()->IsCharacter()) { if (parent->GetPhysicsController() && parent->GetPhysicsController()->IsCharacter()) {
MT_Vector3 vec(0.0, 0.0, 0.0); MT_Vector3 vec(0.0, 0.0, 0.0);
parent->ApplyMovement(vec, true); parent->ApplyMovement(vec, true);
} }