From d4601c22b079c5e1eb25330c586405e3a52261af Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 22 Oct 2022 12:00:11 -0400 Subject: [PATCH] CScriptMidi: Update for CEntity getters --- include/MetroidPrime/CEntity.hpp | 1 + src/MetroidPrime/ScriptObjects/CScriptMidi.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/MetroidPrime/CEntity.hpp b/include/MetroidPrime/CEntity.hpp index c0c16810..5a6a8658 100644 --- a/include/MetroidPrime/CEntity.hpp +++ b/include/MetroidPrime/CEntity.hpp @@ -29,6 +29,7 @@ public: } TUniqueId GetUniqueId() const { return x8_uid; } TEditorId GetEditorId() const { return xc_editorId; } + const rstl::string& GetDebugName() const { return x10_name; } TAreaId GetAreaId() const; TAreaId GetCurrentAreaId() const { return x4_areaId; } bool GetActive() const { return x30_24_active; } diff --git a/src/MetroidPrime/ScriptObjects/CScriptMidi.cpp b/src/MetroidPrime/ScriptObjects/CScriptMidi.cpp index ff8196fd..438f090d 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptMidi.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptMidi.cpp @@ -43,9 +43,9 @@ void CScriptMidi::Play(CStateManager& mgr, float fadeTime) { short volume = x48_volume; const CWorld* wld = mgr.GetWorld(); - const CGameArea& area = wld->GetAreaAlways(GetAreaIdAlways()); + const CGameArea& area = wld->GetAreaAlways(GetCurrentAreaId()); rstl::string twkName = CInGameTweakManager::GetIdentifierForMidiEvent( - wld->GetWorldAssetId(), area.GetAreaAssetId(), x10_name); + wld->GetWorldAssetId(), area.GetAreaAssetId(), GetDebugName()); if (gpTweakManager->HasTweakValue(twkName)) { const CTweakValue::Audio& audio = gpTweakManager->GetTweakValue(twkName)->GetAudio(); @@ -59,9 +59,9 @@ void CScriptMidi::Play(CStateManager& mgr, float fadeTime) { void CScriptMidi::Stop(CStateManager& mgr, float fadeTime) { const CWorld* wld = mgr.GetWorld(); - const CGameArea& area = wld->GetAreaAlways(GetAreaIdAlways()); + const CGameArea& area = wld->GetAreaAlways(GetCurrentAreaId()); const rstl::string twkName = CInGameTweakManager::GetIdentifierForMidiEvent( - wld->GetWorldAssetId(), area.GetAreaAssetId(), x10_name); + wld->GetWorldAssetId(), area.GetAreaAssetId(), GetDebugName()); if (gpTweakManager->HasTweakValue(twkName)) { const CTweakValue::Audio& audio = gpTweakManager->GetTweakValue(twkName)->GetAudio();