Implement/match Pizzeria::Create (#862)

This commit is contained in:
Christian Semmler 2024-04-27 10:06:12 -04:00 committed by GitHub
parent f6ffeabed7
commit 659599b635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 41 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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