BGE: Second fix for #34330 "Action Actuator "caching" the previous ran actions" reported by Dalai. Now the multiple layers should also be working. When doing fcurve/IPO animations, the controllers are cleared as soon as the action is done and must be setup again every time the action is played.
This commit is contained in:
@@ -152,40 +152,37 @@ bool BL_Action::Play(const char* name,
|
||||
&& m_priority == priority && m_speed == playback_speed)
|
||||
return false;
|
||||
|
||||
if (prev_action != m_action)
|
||||
{
|
||||
// First get rid of any old controllers
|
||||
ClearControllerList();
|
||||
// First get rid of any old controllers
|
||||
ClearControllerList();
|
||||
|
||||
// Create an SG_Controller
|
||||
SG_Controller *sg_contr = BL_CreateIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
// Create an SG_Controller
|
||||
SG_Controller *sg_contr = BL_CreateIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
|
||||
// Try obcolor
|
||||
sg_contr = BL_CreateObColorIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
if (sg_contr) {
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
|
||||
// Try obcolor
|
||||
sg_contr = BL_CreateObColorIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
if (sg_contr) {
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
|
||||
// Extra controllers
|
||||
if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
|
||||
{
|
||||
sg_contr = BL_CreateLampIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
else if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA)
|
||||
{
|
||||
sg_contr = BL_CreateCameraIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
// Extra controllers
|
||||
if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
|
||||
{
|
||||
sg_contr = BL_CreateLampIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
else if (m_obj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA)
|
||||
{
|
||||
sg_contr = BL_CreateCameraIPO(m_action, m_obj, kxscene->GetSceneConverter());
|
||||
m_sg_contr_list.push_back(sg_contr);
|
||||
m_obj->GetSGNode()->AddSGController(sg_contr);
|
||||
sg_contr->SetObject(m_obj->GetSGNode());
|
||||
}
|
||||
|
||||
m_ipo_flags = ipo_flags;
|
||||
@@ -467,4 +464,7 @@ void BL_Action::Update(float curtime)
|
||||
|
||||
m_obj->UpdateIPO(m_localtime, m_ipo_flags & ACT_IPOFLAG_CHILD);
|
||||
}
|
||||
|
||||
if (m_done)
|
||||
ClearControllerList();
|
||||
}
|
||||
|
Reference in New Issue
Block a user