From 051137e8e107d12d9185241fdb79b971d290aea0 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 3 Aug 2024 11:10:57 -0700 Subject: [PATCH] Add PlayAction --- LEGO1/lego/legoomni/include/towtrack.h | 22 ++++++++++----------- LEGO1/lego/legoomni/src/actors/towtrack.cpp | 16 ++++++++++----- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/LEGO1/lego/legoomni/include/towtrack.h b/LEGO1/lego/legoomni/include/towtrack.h index 03911eda..da5ca2aa 100644 --- a/LEGO1/lego/legoomni/include/towtrack.h +++ b/LEGO1/lego/legoomni/include/towtrack.h @@ -105,18 +105,18 @@ class TowTrack : public IslePathActor { private: void Leave(); - void PlayAction(IsleScript::Script); + void PlayAction(IsleScript::Script p_objectId); - undefined4 m_unk0x160; // 0x160 - TowTrackMissionState* m_state; // 0x164 - MxS16 m_unk0x168; // 0x168 - MxS16 m_actorId; // 0x16a - MxS16 m_unk0x16c; // 0x16c - MxS16 m_unk0x16e; // 0x16e - MxS32 m_unk0x170; // 0x170 - MxS32 m_unk0x174; // 0x174 - MxFloat m_fuel; // 0x178 - MxFloat m_time; // 0x17c + undefined4 m_unk0x160; // 0x160 + TowTrackMissionState* m_state; // 0x164 + MxS16 m_unk0x168; // 0x168 + MxS16 m_actorId; // 0x16a + MxS16 m_unk0x16c; // 0x16c + MxS16 m_unk0x16e; // 0x16e + IsleScript::Script m_lastAction; // 0x170 + MxS32 m_unk0x174; // 0x174 + MxFloat m_fuel; // 0x178 + MxFloat m_time; // 0x17c }; #endif // TOWTRACK_H diff --git a/LEGO1/lego/legoomni/src/actors/towtrack.cpp b/LEGO1/lego/legoomni/src/actors/towtrack.cpp index 510ed621..a6fc0455 100644 --- a/LEGO1/lego/legoomni/src/actors/towtrack.cpp +++ b/LEGO1/lego/legoomni/src/actors/towtrack.cpp @@ -10,6 +10,7 @@ #include "legovariables.h" #include "legoworld.h" #include "misc.h" +#include "mxbackgroundaudiomanager.h" #include "mxmisc.h" #include "mxsoundpresenter.h" #include "mxtimer.h" @@ -26,7 +27,7 @@ TowTrack::TowTrack() m_actorId = -1; m_state = NULL; m_unk0x16c = 0; - m_unk0x170 = -1; + m_lastAction = IsleScript::c_noneIsle; m_unk0x16e = 0; m_unk0x174 = -1; m_maxLinearVel = 40.0; @@ -190,7 +191,7 @@ MxLong TowTrack::HandleClick() } else { SpawnPlayer(LegoGameState::e_unk28, TRUE, 0); - m_unk0x170 = -1; + m_lastAction = IsleScript::c_noneIsle; m_unk0x174 = -1; m_state->m_unk0x0c = Timer()->GetTime(); m_state->m_unk0x10 = FALSE; @@ -302,10 +303,15 @@ void TowTrack::FUN_1004dbe0() // TODO } -// STUB: LEGO1 0x1004dcf0 -void TowTrack::PlayAction(IsleScript::Script) +// FUNCTION: LEGO1 0x1004dcf0 +void TowTrack::PlayAction(IsleScript::Script p_objectId) { - // TODO + if (p_objectId != -1) { + InvokeAction(Extra::e_start, *g_isleScript, p_objectId, NULL); + } + + m_lastAction = p_objectId; + BackgroundAudioManager()->LowerVolume(); } // FUNCTION: LEGO1 0x1004dd30