From 3fd463fc8a8c12ff18fcfc880f8324f9acfd7c66 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Mon, 3 Oct 2022 19:30:33 +0300 Subject: [PATCH] Use GetIdListForScript in CScriptSpecialFunction::AcceptScriptMsg --- .../ScriptObjects/CScriptSpecialFunction.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp b/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp index 8d75e474..ff8ab4f9 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp @@ -343,13 +343,13 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId continue; } - // GetIdListForScript seems very different between Ghidra and Metaforce - // const auto search = mgr.GetIdListForScript(conn->x8_objId); - - rstl::pair< TUniqueId, TUniqueId >* it; - if (CActor* act = TCastToPtr< CActor >(mgr.ObjectById(it->second))) { - x198_ringControllers.push_back(SRingController(it->second, 0.f, false)); - act->RemoveMaterial(kMT_Occluder, mgr); + const CStateManager::TIdListResult& it = mgr.GetIdListForScript(conn->x8_objId); + if (it.first != it.second) { + TUniqueId uid = it.first->second; + if (CActor* act = TCastToPtr< CActor >(mgr.ObjectById(uid))) { + x198_ringControllers.push_back(SRingController(uid, 0.f, false)); + act->RemoveMaterial(kMT_Occluder, mgr); + } } }