Implement/match Ambulance::HandleClick

This commit is contained in:
Christian Semmler 2024-06-11 13:52:10 -04:00
parent 5311951bc7
commit 6439f46eea
2 changed files with 39 additions and 4 deletions

View File

@ -49,7 +49,7 @@ class AmbulanceMissionState : public LegoState {
// AmbulanceMissionState::`scalar deleting destructor'
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxLong m_unk0x0c; // 0x0c
MxU16 m_unk0x10; // 0x10
MxU16 m_unk0x12; // 0x12
MxU16 m_unk0x14; // 0x14

View File

@ -1,6 +1,7 @@
#include "ambulance.h"
#include "decomp.h"
#include "isle.h"
#include "isle_actions.h"
#include "legoanimationmanager.h"
#include "legocontrolmanager.h"
@ -14,6 +15,7 @@
#include "mxmisc.h"
#include "mxticklemanager.h"
#include "mxtimer.h"
#include "mxtransitionmanager.h"
#include "mxvariabletable.h"
#include "scripts.h"
@ -103,6 +105,10 @@ MxLong Ambulance::Notify(MxParam& p_param)
{
MxLong result = 0;
char asd[123];
sprintf(asd, "%d\n", ((MxNotificationParam&) p_param).GetType());
OutputDebugString(asd);
switch (((MxNotificationParam&) p_param).GetType()) {
case c_notificationType0:
result = HandleNotification0();
@ -227,11 +233,40 @@ MxLong Ambulance::HandleNotification19(MxType19NotificationParam& p_param)
return 0;
}
// STUB: LEGO1 0x10036ce0
// FUNCTION: LEGO1 0x10036ce0
// FUNCTION: BETA10 0x10023506
MxLong Ambulance::HandleClick()
{
// TODO
return 0;
if (((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 != 10) {
return 1;
}
if (m_state->m_unk0x08 == 2) {
return 1;
}
FUN_10015820(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) CurrentActor())->Exit();
}
m_time = Timer()->GetTime();
m_unk0x16a = CurrentActor()->GetActorId();
Enter();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
ControlManager()->Register(this);
if (m_state->m_unk0x08 == 1) {
SpawnPlayer(LegoGameState::e_unk31, TRUE, 0);
m_state->m_unk0x0c = Timer()->GetTime();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns018rd_RunAnim, NULL);
}
return 1;
}
// STUB: LEGO1 0x10036e60