diff options
Diffstat (limited to 'source/gameengine/Converter/BL_ActionActuator.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index d4cfeb2201a..d28cdb84275 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -307,6 +307,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) } switch (m_playtype) { + case ACT_ACTION_FROM_PROP: case ACT_ACTION_LOOP_STOP: obj->StopAction(m_layer); // Stop the action after getting the frame @@ -335,6 +336,17 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return m_flag & ACT_FLAG_ACTIVE; } +void BL_ActionActuator::DecLink() +{ + SCA_IActuator::DecLink(); + /* In this case no controllers use this action actuator, + and it should stop its action. */ + if (m_links == 0) { + KX_GameObject *obj = (KX_GameObject *)GetParent(); + obj->StopAction(m_layer); + } +} + #ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ @@ -572,7 +584,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF if (val != "") { - action= (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(val); + action= (bAction*)self->GetLogicManager()->GetActionByName(val); if (!action) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, action not found!"); |