void CComponentDestroyable::ReceiveEvent(const SEvent& _Event) { CGameEntity* l_pEntity = GetEntity(); if(_Event.Receiver == l_pEntity->GetGUID()) { if(_Event.Msg == SEvent::MORIR) { //Script de destrucció m_bDestroyed = true; CallAction(); //Canvi de mesh CComponentRenderableObject* l_pRO = l_pEntity->GetComponent<CComponentRenderableObject>(ECT_RENDERABLE_OBJECT); if(l_pRO) { if(m_szResource != "") { if(!l_pRO->ChangeInstance(m_szResource)) { LOGGER->AddNewLog(ELL_WARNING, "CComponentDestroyable::No s'ha trobat la mesh \"%s\" de l'objecte destruït. Procedint a eliminar l'entitat \"%s\"", m_szResource.c_str(), l_pEntity->GetName().c_str()); l_pRO->SetActive(false); l_pRO->m_bRemoveRenderableObject = true; ENTITY_MANAGER->RemoveEntity(l_pEntity); } }else { l_pRO->m_bRemoveRenderableObject = true; ENTITY_MANAGER->RemoveEntity(l_pEntity); } } } } }
// Fix for MHActionGenericObjectRef void MHActionGenericObjectRefFix::Perform(MHEngine *engine) { MHObjectRef ref; if (m_RefObject.m_fIsDirect) m_RefObject.GetValue(ref, engine); else ref.Copy(*m_RefObject.GetReference()); CallAction(engine, Target(engine), engine->FindObject(ref)); }
void MHActionIntInt::Perform(MHEngine *engine) { CallAction(engine, Target(engine), m_Argument1.GetValue(engine), m_Argument2.GetValue(engine)); }
void MHActionObjectRef2::Perform(MHEngine *engine) { CallAction(engine, Target(engine), engine->FindObject(m_ResultVar1), engine->FindObject(m_ResultVar2)); }
void MHActionGenericObjectRef::Perform(MHEngine *engine) { MHObjectRef reference; m_RefObject.GetValue(reference, engine); CallAction(engine, Target(engine), engine->FindObject(reference)); }