BGE bugfix, ipo actuator's foce option didnt check that the object was dynamic.

This commit is contained in:
Campbell Barton 2008-08-27 06:02:10 +00:00
parent d566765635
commit 6cccdf0cb2
2 changed files with 2 additions and 2 deletions

@ -1857,7 +1857,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh
but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE,
"Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19,
&ia->flag, 0, 0, 0, 0,
"Convert Ipo to force. Force is applied in global or local coordinate according to Local flag");
"Apply Ipo as a global or local force depending on the local option (dynamic objects only)");
uiButSetFunc(but, change_ipo_actuator, but, ia);
but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD,

@ -143,7 +143,7 @@ bool KX_IpoSGController::Update(double currentTime)
{
if (m_ipo_as_force == true)
{
if (m_game_object && ob)
if (m_game_object && ob && m_game_object->GetPhysicsController())
{
m_game_object->GetPhysicsController()->ApplyForce(m_ipo_local ?
ob->GetWorldOrientation() * m_ipo_xform.GetPosition() :