mirror of https://github.com/AxioDL/metaforce.git
CScriptMazeNode: Implement Reset
This commit is contained in:
parent
e486e01b2a
commit
529e8f6a07
|
@ -50,8 +50,7 @@ void CScriptMazeNode::GenerateObjects(CStateManager& mgr) {
|
||||||
mgr.SetIsGeneratingObject(true);
|
mgr.SetIsGeneratingObject(true);
|
||||||
const auto genObj = mgr.GenerateObject(conn.x8_objId);
|
const auto genObj = mgr.GenerateObject(conn.x8_objId);
|
||||||
mgr.SetIsGeneratingObject(wasGeneratingObject);
|
mgr.SetIsGeneratingObject(wasGeneratingObject);
|
||||||
auto* actor = static_cast<CActor*>(mgr.ObjectById(genObj.second));
|
if (auto* actor = static_cast<CActor*>(mgr.ObjectById(genObj.second))) {
|
||||||
if (actor != nullptr) {
|
|
||||||
mgr.SendScriptMsg(actor, GetUniqueId(), EScriptObjectMessage::Activate);
|
mgr.SendScriptMsg(actor, GetUniqueId(), EScriptObjectMessage::Activate);
|
||||||
if (scriptEffect) {
|
if (scriptEffect) {
|
||||||
actor->SetTranslation(GetTranslation() + x120_effectPos);
|
actor->SetTranslation(GetTranslation() + x120_effectPos);
|
||||||
|
@ -69,4 +68,15 @@ void CScriptMazeNode::GenerateObjects(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CScriptMazeNode::Reset(CStateManager& mgr) {
|
||||||
|
mgr.FreeScriptObject(x11c_effectId);
|
||||||
|
mgr.FreeScriptObject(xfc_actorId);
|
||||||
|
mgr.FreeScriptObject(x10c_triggerId);
|
||||||
|
mgr.FreeScriptObject(xf4_);
|
||||||
|
xf4_ = kInvalidUniqueId;
|
||||||
|
xfc_actorId = kInvalidUniqueId;
|
||||||
|
x10c_triggerId = kInvalidUniqueId;
|
||||||
|
x11c_effectId = kInvalidUniqueId;
|
||||||
|
}
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -61,5 +61,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GenerateObjects(CStateManager& mgr);
|
void GenerateObjects(CStateManager& mgr);
|
||||||
|
void Reset(CStateManager& mgr);
|
||||||
};
|
};
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
Loading…
Reference in New Issue