diff --git a/LEGO1/lego/legoomni/include/pizzeria.h b/LEGO1/lego/legoomni/include/pizzeria.h index e4de7b6c..0f36dbdf 100644 --- a/LEGO1/lego/legoomni/include/pizzeria.h +++ b/LEGO1/lego/legoomni/include/pizzeria.h @@ -4,11 +4,14 @@ #include "decomp.h" #include "isleactor.h" +class PizzeriaState; +class PizzaMissionState; + // VTABLE: LEGO1 0x100d5520 // SIZE 0x84 class Pizzeria : public IsleActor { public: - Pizzeria() : m_unk0x7c(0) {} + Pizzeria() : m_pizzeriaState(NULL) {} // FUNCTION: LEGO1 0x1000e780 inline const char* ClassName() const override // vtable+0x0c @@ -30,8 +33,10 @@ class Pizzeria : public IsleActor { // Pizzeria::`scalar deleting destructor' private: - undefined4 m_unk0x7c; // 0x7c - undefined4 m_unk0x80; // 0x80 + void Init(); + + PizzeriaState* m_pizzeriaState; // 0x7c + PizzaMissionState* m_pizzaMissionState; // 0x80 }; #endif // PIZZERIA_H diff --git a/LEGO1/lego/legoomni/src/actors/isleactor.cpp b/LEGO1/lego/legoomni/src/actors/isleactor.cpp index 7d8dae64..9281a443 100644 --- a/LEGO1/lego/legoomni/src/actors/isleactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/isleactor.cpp @@ -11,17 +11,17 @@ DECOMP_SIZE_ASSERT(IsleActor, 0x7c) // FUNCTION: LEGO1 0x1002c780 MxResult IsleActor::Create(MxDSAction& p_dsAction) { - MxResult ret = LegoEntity::Create(p_dsAction); + MxResult result = LegoEntity::Create(p_dsAction); - if (ret == SUCCESS) { + if (result == SUCCESS) { m_world = CurrentWorld(); if (!m_world) { - ret = FAILURE; + result = FAILURE; } } - return ret; + return result; } // FUNCTION: LEGO1 0x1002c7b0 diff --git a/LEGO1/lego/legoomni/src/actors/pizzeria.cpp b/LEGO1/lego/legoomni/src/actors/pizzeria.cpp index ce35f634..2346914b 100644 --- a/LEGO1/lego/legoomni/src/actors/pizzeria.cpp +++ b/LEGO1/lego/legoomni/src/actors/pizzeria.cpp @@ -1,12 +1,38 @@ #include "pizzeria.h" +#include "legogamestate.h" +#include "misc.h" + DECOMP_SIZE_ASSERT(Pizzeria, 0x84) -// STUB: LEGO1 0x100179c0 +// FUNCTION: LEGO1 0x100179c0 MxResult Pizzeria::Create(MxDSAction& p_dsAction) { - // TODO - return SUCCESS; + MxResult result = IsleActor::Create(p_dsAction); + + if (result == SUCCESS) { + Init(); + } + + return result; +} + +// FUNCTION: LEGO1 0x100179f0 +void Pizzeria::Init() +{ + LegoGameState* gameState = GameState(); + PizzeriaState* pizzeriaState = (PizzeriaState*) gameState->GetState("PizzeriaState"); + if (pizzeriaState == NULL) { + pizzeriaState = (PizzeriaState*) gameState->CreateState("PizzeriaState"); + } + m_pizzeriaState = pizzeriaState; + + gameState = GameState(); + PizzaMissionState* pizzaMissionState = (PizzaMissionState*) gameState->GetState("PizzaMissionState"); + if (pizzaMissionState == NULL) { + pizzaMissionState = (PizzaMissionState*) gameState->CreateState("PizzaMissionState"); + } + m_pizzaMissionState = pizzaMissionState; } // STUB: LEGO1 0x10017a50