diff --git a/LEGO1/lego/legoomni/include/ambulancemissionstate.h b/LEGO1/lego/legoomni/include/ambulancemissionstate.h index 88bcf4b8..002d2803 100644 --- a/LEGO1/lego/legoomni/include/ambulancemissionstate.h +++ b/LEGO1/lego/legoomni/include/ambulancemissionstate.h @@ -24,8 +24,6 @@ class AmbulanceMissionState : public LegoState { MxResult Serialize(LegoFile* p_legoFile) override; // vtable+0x1c - inline void SetUnknown0x08(undefined4 p_unk0x08) { m_unk0x08 = p_unk0x08; } - inline MxU16 GetScore(MxU8 p_id) { switch (p_id) { @@ -47,7 +45,6 @@ class AmbulanceMissionState : public LegoState { // SYNTHETIC: LEGO1 0x100376c0 // AmbulanceMissionState::`scalar deleting destructor' -protected: undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x0c; // 0x0c MxU16 m_unk0x10; // 0x10 diff --git a/LEGO1/lego/legoomni/include/isleactor.h b/LEGO1/lego/legoomni/include/isleactor.h index 1affab4a..ad2e985d 100644 --- a/LEGO1/lego/legoomni/include/isleactor.h +++ b/LEGO1/lego/legoomni/include/isleactor.h @@ -49,7 +49,7 @@ class IsleActor : public LegoActor { // FUNCTION: LEGO1 0x1000e650 virtual undefined4 VTable0x80(MxParam&) { return 0; } // vtable+0x80 -private: +protected: LegoWorld* m_world; // 0x78 }; diff --git a/LEGO1/lego/legoomni/include/islepathactor.h b/LEGO1/lego/legoomni/include/islepathactor.h index 1b795be0..43d301cf 100644 --- a/LEGO1/lego/legoomni/include/islepathactor.h +++ b/LEGO1/lego/legoomni/include/islepathactor.h @@ -128,9 +128,6 @@ class IslePathActor : public LegoPathActor { // SYNTHETIC: LEGO1 0x10002ff0 // IslePathActor::`scalar deleting destructor' - inline void SetWorld(LegoWorld* p_world) { m_world = p_world; } - inline LegoWorld* GetWorld() { return m_world; } - void FUN_1001b660(); static void RegisterSpawnLocations(); diff --git a/LEGO1/lego/legoomni/include/legovariables.h b/LEGO1/lego/legoomni/include/legovariables.h index ec02c530..9ef1a197 100644 --- a/LEGO1/lego/legoomni/include/legovariables.h +++ b/LEGO1/lego/legoomni/include/legovariables.h @@ -4,6 +4,7 @@ #include "mxvariable.h" extern const char* g_varAMBULFUEL; +extern const char* g_varTOWFUEL; extern const char* g_varVISIBILITY; extern const char* g_varCAMERALOCATION; extern const char* g_varCURSOR; diff --git a/LEGO1/lego/legoomni/include/towtrack.h b/LEGO1/lego/legoomni/include/towtrack.h index 0c91e8a7..8e5ecfc0 100644 --- a/LEGO1/lego/legoomni/include/towtrack.h +++ b/LEGO1/lego/legoomni/include/towtrack.h @@ -51,7 +51,7 @@ class TowTrack : public IslePathActor { MxS32 m_unk0x170; // 0x170 MxS32 m_unk0x174; // 0x174 MxFloat m_unk0x178; // 0x178 - undefined4 m_unk0x17c; // 0x17c + MxFloat m_time; // 0x17c }; #endif // TOWTRACK_H diff --git a/LEGO1/lego/legoomni/include/towtrackmissionstate.h b/LEGO1/lego/legoomni/include/towtrackmissionstate.h index da9361f2..5a684011 100644 --- a/LEGO1/lego/legoomni/include/towtrackmissionstate.h +++ b/LEGO1/lego/legoomni/include/towtrackmissionstate.h @@ -45,7 +45,6 @@ class TowTrackMissionState : public LegoState { // SYNTHETIC: LEGO1 0x1004e060 // TowTrackMissionState::`scalar deleting destructor' -protected: undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x0c; // 0x0c MxU8 m_unk0x10; // 0x10 diff --git a/LEGO1/lego/legoomni/src/actors/ambulance.cpp b/LEGO1/lego/legoomni/src/actors/ambulance.cpp index d7f7ebb4..8f7f05d1 100644 --- a/LEGO1/lego/legoomni/src/actors/ambulance.cpp +++ b/LEGO1/lego/legoomni/src/actors/ambulance.cpp @@ -58,7 +58,7 @@ MxResult Ambulance::Create(MxDSAction& p_dsAction) m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState"); if (!m_state) { m_state = new AmbulanceMissionState(); - m_state->SetUnknown0x08(0); + m_state->m_unk0x08 = 0; GameState()->RegisterState(m_state); } } diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 8307e07a..06eba4e0 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -40,15 +40,16 @@ Helicopter::~Helicopter() MxResult Helicopter::Create(MxDSAction& p_dsAction) { MxResult result = IslePathActor::Create(p_dsAction); - LegoWorld* world = CurrentWorld(); - SetWorld(world); - if (world->IsA("Act3")) { - ((Act3*) GetWorld())->SetUnknown420c(this); + + m_world = CurrentWorld(); + if (m_world->IsA("Act3")) { + ((Act3*) m_world)->SetUnknown420c(this); } - world = GetWorld(); - if (world) { - world->Add(this); + + if (m_world != NULL) { + m_world->Add(this); } + CreateState(); return result; } diff --git a/LEGO1/lego/legoomni/src/actors/pizza.cpp b/LEGO1/lego/legoomni/src/actors/pizza.cpp index 236536b0..d3779d40 100644 --- a/LEGO1/lego/legoomni/src/actors/pizza.cpp +++ b/LEGO1/lego/legoomni/src/actors/pizza.cpp @@ -1,7 +1,9 @@ #include "pizza.h" #include "act1state.h" +#include "isle_actions.h" #include "legogamestate.h" +#include "legoworld.h" #include "misc.h" #include "mxmisc.h" #include "mxticklemanager.h" @@ -27,11 +29,17 @@ Pizza::~Pizza() TickleManager()->UnregisterClient(this); } -// STUB: LEGO1 0x10038170 +// FUNCTION: LEGO1 0x10038170 MxResult Pizza::Create(MxDSAction& p_dsAction) { - // TODO - return SUCCESS; + MxResult result = IsleActor::Create(p_dsAction); + + if (result == SUCCESS) { + CreateState(); + m_skateboard = (SkateBoard*) m_world->Find(m_atom, IsleScript::c_SkateBoard_Actor); + } + + return result; } // FUNCTION: LEGO1 0x100381b0 diff --git a/LEGO1/lego/legoomni/src/actors/towtrack.cpp b/LEGO1/lego/legoomni/src/actors/towtrack.cpp index 25b939e0..2337fa4b 100644 --- a/LEGO1/lego/legoomni/src/actors/towtrack.cpp +++ b/LEGO1/lego/legoomni/src/actors/towtrack.cpp @@ -1,7 +1,12 @@ #include "towtrack.h" #include "legogamestate.h" +#include "legovariables.h" +#include "legoworld.h" #include "misc.h" +#include "mxmisc.h" +#include "mxtimer.h" +#include "mxvariabletable.h" #include "towtrackmissionstate.h" DECOMP_SIZE_ASSERT(TowTrack, 0x180) @@ -20,11 +25,31 @@ TowTrack::TowTrack() m_unk0x178 = 1.0; } -// STUB: LEGO1 0x1004c9e0 +// FUNCTION: LEGO1 0x1004c9e0 +// FUNCTION: BETA10 0x100f6bf1 MxResult TowTrack::Create(MxDSAction& p_dsAction) { - // TODO - return SUCCESS; + MxResult result = IslePathActor::Create(p_dsAction); + + if (result == SUCCESS) { + m_world = CurrentWorld(); + + if (m_world) { + m_world->Add(this); + } + + m_state = (TowTrackMissionState*) GameState()->GetState("TowTrackMissionState"); + if (!m_state) { + m_state = new TowTrackMissionState(); + m_state->m_unk0x08 = 0; + GameState()->RegisterState(m_state); + } + } + + VariableTable()->SetVariable(g_varTOWFUEL, "1.0"); + m_unk0x178 = 1.0; + m_time = Timer()->GetTime(); + return result; } // STUB: LEGO1 0x1004cb10 diff --git a/LEGO1/lego/legoomni/src/common/legovariables.cpp b/LEGO1/lego/legoomni/src/common/legovariables.cpp index 7dc427b8..38b5b5e8 100644 --- a/LEGO1/lego/legoomni/src/common/legovariables.cpp +++ b/LEGO1/lego/legoomni/src/common/legovariables.cpp @@ -20,6 +20,10 @@ DECOMP_SIZE_ASSERT(CustomizeAnimFileVariable, 0x24) // STRING: LEGO1 0x100f39a0 const char* g_varAMBULFUEL = "ambulFUEL"; +// GLOBAL: LEGO1 0x100f43b4 +// STRING: LEGO1 0x100f439c +const char* g_varTOWFUEL = "towFUEL"; + // GLOBAL: LEGO1 0x100f3a40 // STRING: LEGO1 0x100f3808 const char* g_varVISIBILITY = "VISIBILITY";