From 97ebb22c423d298b727d5182559830b8047873d7 Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Wed, 27 Mar 2024 15:46:03 -0400 Subject: [PATCH] implement/match FUN_1003ef60() (#740) --- LEGO1/lego/legoomni/src/common/legoutils.cpp | 29 ++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index b87e5d60..fc0585f6 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -1,5 +1,8 @@ #include "legoutils.h" +#include "act1state.h" +#include "islepathactor.h" +#include "legogamestate.h" #include "legoinputmanager.h" #include "legonamedtexture.h" #include "legoomni.h" @@ -308,10 +311,32 @@ void SetAppCursor(WPARAM p_wparam) PostMessageA(MxOmni::GetInstance()->GetWindowHandle(), 0x5400, p_wparam, 0); } -// STUB: LEGO1 0x1003ef60 +// FUNCTION: LEGO1 0x1003ef60 MxBool FUN_1003ef60() { - return TRUE; + Act1State* act1State = (Act1State*) GameState()->GetState("Act1State"); + + if (GameState()->m_currentArea != LegoGameState::e_elevride && + GameState()->m_currentArea != LegoGameState::e_elevride2 && + GameState()->m_currentArea != LegoGameState::e_elevopen && + GameState()->m_currentArea != LegoGameState::e_seaview && + GameState()->m_currentArea != LegoGameState::e_observe && + GameState()->m_currentArea != LegoGameState::e_elevdown && + GameState()->m_currentArea != LegoGameState::e_garadoor && + GameState()->m_currentArea != LegoGameState::e_polidoor) { + + if (CurrentActor() == NULL || !CurrentActor()->IsA("TowTrack")) { + if (CurrentActor() == NULL || !CurrentActor()->IsA("Ambulance")) { + MxU32 unk0x18 = act1State->GetUnknown18(); + + if (unk0x18 != 10 && unk0x18 != 8 && unk0x18 != 3) { + return TRUE; + } + } + } + } + + return FALSE; } // STUB: LEGO1 0x1003f050