From f0261ab3c5e490ccac9a7782a0ca9db0a5b815f4 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 14 Oct 2022 11:06:32 -0700 Subject: [PATCH] Get close to matching CScriptAreaAttributes Former-commit-id: b818531567ba766899772d703d42f1b9eee2e834 --- .../ScriptObjects/CScriptAreaAttributes.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/MetroidPrime/ScriptObjects/CScriptAreaAttributes.cpp b/src/MetroidPrime/ScriptObjects/CScriptAreaAttributes.cpp index bca95068..efeea676 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptAreaAttributes.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptAreaAttributes.cpp @@ -25,18 +25,14 @@ void CScriptAreaAttributes::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId switch (msg) { case kSM_InitializedInArea: { - TAreaId areaId = x4_areaId; - stateMgr.World()->Area(areaId)->SetAreaAttributes(this); + stateMgr.World()->Area(GetAreaIdAlways())->SetAreaAttributes(this); stateMgr.EnvFxManager()->SetFxDensity(500, x3c_envFxDensity); break; } case kSM_Deleted: { - TAreaId areaId = x4_areaId; - CGameArea* area = stateMgr.World()->Area(areaId); - - if (area->IsLoaded()) { - area->SetAreaAttributes(nullptr); + if (stateMgr.World()->Area(GetAreaIdAlways())->IsLoaded()) { + stateMgr.World()->Area(GetAreaIdAlways())->SetAreaAttributes(nullptr); } } }