From a9a564b25e9f466852a83d8136a4eb3463bb0295 Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Wed, 13 Mar 2024 15:10:53 -0400 Subject: [PATCH] implement/match Hospital::~Hospital() (#669) --- LEGO1/lego/legoomni/src/worlds/hospital.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index 4624eaf6..540a5b32 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -6,9 +6,13 @@ #include "misc.h" #include "mxmisc.h" #include "mxnotificationmanager.h" +#include "mxticklemanager.h" DECOMP_SIZE_ASSERT(Hospital, 0x12c) +// GLOBAL: LEGO1 0x100f7918 +undefined4 g_unk0x100f7918 = 3; + // FUNCTION: LEGO1 0x100745e0 Hospital::Hospital() { @@ -33,10 +37,21 @@ MxBool Hospital::VTable0x5c() return TRUE; } -// STUB: LEGO1 0x100747f0 +// FUNCTION: LEGO1 0x100747f0 Hospital::~Hospital() { - // TODO + InputManager()->UnRegister(this); + if (InputManager()->GetWorld() == this) { + InputManager()->ClearWorld(); + } + + ControlManager()->Unregister(this); + TickleManager()->UnregisterClient(this); + + m_hospitalState->m_unk0x08.m_unk0x00 = 3; + + NotificationManager()->Unregister(this); + g_unk0x100f7918 = 3; } // FUNCTION: LEGO1 0x100748c0