From 13d4a94ee10f69dac00dba26caeb02e2a8e73701 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 9 Jan 2022 17:17:51 -0800 Subject: [PATCH] PhazonBeam fixes, add debug hack for Metroid Prime's lair cutscene trigger --- Runtime/Weapon/CPhazonBeam.cpp | 4 ++-- Runtime/Weapon/CPlayerGun.cpp | 2 +- Runtime/World/CScriptTrigger.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Runtime/Weapon/CPhazonBeam.cpp b/Runtime/Weapon/CPhazonBeam.cpp index a88b40a58..df3d3a809 100644 --- a/Runtime/Weapon/CPhazonBeam.cpp +++ b/Runtime/Weapon/CPhazonBeam.cpp @@ -208,9 +208,9 @@ void CPhazonBeam::Draw(bool drawSuitArm, const CStateManager& mgr, const zeus::C } if (x274_26_veinsAlphaActive) { CModelFlags useFlags(5, 0, 3, zeus::CColor(1.f, 0.5f * x270_indirectAlpha)); - x224_phazonVeinsData->Render(mgr, xf, lights, useFlags); + x224_phazonVeinsData->Render(mgr, modelXf * zeus::CTransform::Scale(x270_indirectAlpha), lights, useFlags); } else { - x224_phazonVeinsData->Render(mgr, xf, lights, flags); + x224_phazonVeinsData->Render(mgr, modelXf, lights, flags); } } } diff --git a/Runtime/Weapon/CPlayerGun.cpp b/Runtime/Weapon/CPlayerGun.cpp index e67ffe1b4..80d99a2ed 100644 --- a/Runtime/Weapon/CPlayerGun.cpp +++ b/Runtime/Weapon/CPlayerGun.cpp @@ -632,7 +632,7 @@ void CPlayerGun::HandlePhazonBeamChange(CStateManager& mgr) { inMorph = true; break; case EPhazonBeamState::Active: - if (!x835_25_inPhazonBeam) { + if (!x835_24_canFirePhazon) { SetPhazonBeamMorph(true); x338_nextState = ENextState::ExitPhazonBeam; inMorph = true; diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index a1c9ce45e..0e34dcb26 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -34,6 +34,13 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, std::string_view name, const CEnti GetEditorId(), GetAreaIdAlways()); x11c_forceField.x() = 0.f; } +#else + // HACK: For some reason MetroidPrime's lair doesn't enable this trigger until after the cutscene, activate it in debug build + if (GetEditorId() == 0x000B01DB && !GetActive()) { + Log.report(logvisor::Warning, FMT_STRING("BUG THIS!: Overriding active for trigger {} in area {}"), GetEditorId(), + GetAreaIdAlways()); + SetActive(true); + } #endif }