From aceba71fbb1c39ed560075ce0010fdba791f3de7 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 12 Dec 2024 09:10:44 -0700 Subject: [PATCH] Implement/match `Act3Brickster::HitActor` (#1212) * Implement/match `Act3Brickster::HitActor` * Fixes * Fixes * Fixes * Add `Act3Cop::VTable0x9c` * Fix --- LEGO1/lego/legoomni/include/act2actor.h | 2 +- LEGO1/lego/legoomni/include/act2brick.h | 2 +- LEGO1/lego/legoomni/include/act2genactor.h | 2 +- LEGO1/lego/legoomni/include/act3.h | 9 ++- LEGO1/lego/legoomni/include/act3actors.h | 24 +++--- LEGO1/lego/legoomni/include/act3ammo.h | 2 + LEGO1/lego/legoomni/include/doors.h | 8 +- LEGO1/lego/legoomni/include/legoextraactor.h | 16 ++-- LEGO1/lego/legoomni/include/legojetski.h | 6 +- LEGO1/lego/legoomni/include/legopathactor.h | 2 +- LEGO1/lego/legoomni/include/legoraceactor.h | 2 +- LEGO1/lego/legoomni/include/legoracers.h | 6 +- LEGO1/lego/legoomni/src/actors/act2actor.cpp | 4 +- .../lego/legoomni/src/actors/act2genactor.cpp | 2 +- LEGO1/lego/legoomni/src/actors/act3actors.cpp | 81 +++++++++++++++---- LEGO1/lego/legoomni/src/actors/doors.cpp | 2 +- LEGO1/lego/legoomni/src/entity/act2brick.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legojetski.cpp | 2 +- .../src/entity/legojetskiraceactor.cpp | 4 +- .../legoomni/src/paths/legoextraactor.cpp | 10 +-- .../lego/legoomni/src/paths/legopathactor.cpp | 4 +- .../lego/legoomni/src/race/legoraceactor.cpp | 5 +- LEGO1/lego/legoomni/src/race/legoracers.cpp | 3 +- .../legoomni/src/race/legoracespecial.cpp | 13 +-- LEGO1/lego/legoomni/src/worlds/act3.cpp | 31 ++++++- 25 files changed, 166 insertions(+), 78 deletions(-) diff --git a/LEGO1/lego/legoomni/include/act2actor.h b/LEGO1/lego/legoomni/include/act2actor.h index 905743fb..05ddf182 100644 --- a/LEGO1/lego/legoomni/include/act2actor.h +++ b/LEGO1/lego/legoomni/include/act2actor.h @@ -23,7 +23,7 @@ class Act2Actor : public LegoAnimActor { void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30 MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68 void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 + MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94 MxResult VTable0x9c() override; // vtable+0x9c MxS32 VTable0xa0() override; // vtable+0xa0 diff --git a/LEGO1/lego/legoomni/include/act2brick.h b/LEGO1/lego/legoomni/include/act2brick.h index 1ad730f2..addc7261 100644 --- a/LEGO1/lego/legoomni/include/act2brick.h +++ b/LEGO1/lego/legoomni/include/act2brick.h @@ -26,7 +26,7 @@ class Act2Brick : public LegoPathActor { return !strcmp(p_name, Act2Brick::ClassName()) || LegoEntity::IsA(p_name); } - MxResult VTable0x94(LegoPathActor* p_actor, MxBool) override; // vtable+0x94 + MxResult HitActor(LegoPathActor* p_actor, MxBool) override; // vtable+0x94 // SYNTHETIC: LEGO1 0x1007a450 // Act2Brick::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/act2genactor.h b/LEGO1/lego/legoomni/include/act2genactor.h index 1831870e..ab0ce47b 100644 --- a/LEGO1/lego/legoomni/include/act2genactor.h +++ b/LEGO1/lego/legoomni/include/act2genactor.h @@ -6,7 +6,7 @@ // VTABLE: LEGO1 0x100d4ed8 // SIZE 0x154 class Act2GenActor : public LegoPathActor { - MxResult VTable0x94(LegoPathActor* p_actor, MxBool) override; // vtable+0x94 + MxResult HitActor(LegoPathActor* p_actor, MxBool) override; // vtable+0x94 // SYNTHETIC: LEGO1 0x1000f5a0 // Act2GenActor::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/act3.h b/LEGO1/lego/legoomni/include/act3.h index 95390540..dca00a41 100644 --- a/LEGO1/lego/legoomni/include/act3.h +++ b/LEGO1/lego/legoomni/include/act3.h @@ -113,12 +113,12 @@ class Act3 : public LegoWorld { void SetShark(Act3Shark* p_shark) { m_shark = p_shark; } void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } - Act3Brickster* GetBrickster() { return m_brickster; } - // SYNTHETIC: LEGO1 0x10072630 // Act3::`scalar deleting destructor' + void EatPizza(MxS32 p_index); void EatDonut(MxS32 p_index); + void RemovePizza(Act3Ammo& p_p); void RemoveDonut(Act3Ammo& p_p); MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); @@ -128,6 +128,11 @@ class Act3 : public LegoWorld { void GoodEnding(const Matrix4& p_matrix); static void DebugPrintf(const char* p_format, ...); + // BETA indicates that the actors access certain members directly. + friend class Act3Brickster; + friend class Act3Cop; + friend class Act3Shark; + protected: MxLong HandleTransitionEnd(); diff --git a/LEGO1/lego/legoomni/include/act3actors.h b/LEGO1/lego/legoomni/include/act3actors.h index 727e51b5..2de2e47c 100644 --- a/LEGO1/lego/legoomni/include/act3actors.h +++ b/LEGO1/lego/legoomni/include/act3actors.h @@ -23,8 +23,8 @@ class Act3Actor : public LegoAnimActor { return "Act3Actor"; } - MxU32 VTable0x90(float p_time, Matrix4& p_transform) override; // vtable+0x90 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + MxU32 VTable0x90(float p_time, Matrix4& p_transform) override; // vtable+0x90 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 MxFloat GetUnknown0x1c() { return m_unk0x1c; } @@ -37,9 +37,9 @@ class Act3Actor : public LegoAnimActor { // Act3Actor::~Act3Actor private: - MxFloat m_unk0x1c; // 0x1c - static Mx3DPointFloat g_unk0x10104ef0; + + MxFloat m_unk0x1c; // 0x1c }; // VTABLE: LEGO1 0x100d7750 LegoPathActor @@ -49,10 +49,10 @@ class Act3Cop : public Act3Actor { public: Act3Cop(); - void ParseAction(char* p_extra) override; // vtable+0x20 - void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 - MxResult VTable0x9c() override; // vtable+0x9c + void ParseAction(char* p_extra) override; // vtable+0x20 + void VTable0x70(float p_time) override; // vtable+0x70 + MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94 + MxResult VTable0x9c() override; // vtable+0x9c MxFloat GetUnknown0x20() { return m_unk0x20; } @@ -66,7 +66,7 @@ class Act3Cop : public Act3Actor { private: MxFloat m_unk0x20; // 0x20 LegoWorld* m_world; // 0x24 - undefined4 m_unk0x24[2]; // 0x28 + undefined4 m_unk0x28[2]; // 0x28 }; // VTABLE: LEGO1 0x100d7838 LegoPathActor @@ -77,9 +77,9 @@ class Act3Brickster : public Act3Actor { Act3Brickster(); ~Act3Brickster() override; - void ParseAction(char* p_extra) override; // vtable+0x20 - void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 + void ParseAction(char* p_extra) override; // vtable+0x20 + void VTable0x70(float p_time) override; // vtable+0x70 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 void SwitchBoundary( LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, diff --git a/LEGO1/lego/legoomni/include/act3ammo.h b/LEGO1/lego/legoomni/include/act3ammo.h index 4cd45d7a..39271cf8 100644 --- a/LEGO1/lego/legoomni/include/act3ammo.h +++ b/LEGO1/lego/legoomni/include/act3ammo.h @@ -68,6 +68,8 @@ class Act3Ammo : public LegoPathActor { } } + MxU32 IsBit5() { return m_ammoFlag & c_bit5; } + MxFloat GetUnknown0x158() { return m_unk0x158; } void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; } diff --git a/LEGO1/lego/legoomni/include/doors.h b/LEGO1/lego/legoomni/include/doors.h index 2a5e45e3..8f5d8a49 100644 --- a/LEGO1/lego/legoomni/include/doors.h +++ b/LEGO1/lego/legoomni/include/doors.h @@ -24,10 +24,10 @@ class Doors : public LegoPathActor { return !strcmp(p_name, Doors::ClassName()) || LegoPathActor::IsA(p_name); } - void ParseAction(char* p_extra) override; // vtable+0x20 - void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 - virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc + void ParseAction(char* p_extra) override; // vtable+0x20 + void VTable0x70(float p_time) override; // vtable+0x70 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc // SYNTHETIC: LEGO1 0x1000e580 // Doors::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/legoextraactor.h b/LEGO1/lego/legoomni/include/legoextraactor.h index a9d9f2d1..8e19de80 100644 --- a/LEGO1/lego/legoomni/include/legoextraactor.h +++ b/LEGO1/lego/legoomni/include/legoextraactor.h @@ -42,14 +42,14 @@ class LegoExtraActor : public virtual LegoAnimActor { float p_f1, float p_f2, Vector3& p_v3 - ) override; // vtable+0x6c - void VTable0x70(float p_time) override; // vtable+0x70 - void VTable0x74(Matrix4& p_transform) override; // vtable+0x74 - MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 - MxResult VTable0x9c() override; // vtable+0x9c - void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4 - void VTable0xc4() override; // vtable+0xc4 + ) override; // vtable+0x6c + void VTable0x70(float p_time) override; // vtable+0x70 + void VTable0x74(Matrix4& p_transform) override; // vtable+0x74 + MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + MxResult VTable0x9c() override; // vtable+0x9c + void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4 + void VTable0xc4() override; // vtable+0xc4 virtual MxResult FUN_1002aae0(); diff --git a/LEGO1/lego/legoomni/include/legojetski.h b/LEGO1/lego/legoomni/include/legojetski.h index 94daf791..5aa73d7b 100644 --- a/LEGO1/lego/legoomni/include/legojetski.h +++ b/LEGO1/lego/legoomni/include/legojetski.h @@ -39,9 +39,9 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap { float p_f1, float p_f2, Vector3& p_v3 - ) override; // vtable+0x6c - void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + ) override; // vtable+0x6c + void VTable0x70(float p_time) override; // vtable+0x70 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) override; // vtable+0x98 MxResult VTable0x9c() override; // vtable+0x9c diff --git a/LEGO1/lego/legoomni/include/legopathactor.h b/LEGO1/lego/legoomni/include/legopathactor.h index 544dec7a..c7ddfbeb 100644 --- a/LEGO1/lego/legoomni/include/legopathactor.h +++ b/LEGO1/lego/legoomni/include/legopathactor.h @@ -91,7 +91,7 @@ class LegoPathActor : public LegoActor { virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90 // FUNCTION: LEGO1 0x10002d50 - virtual MxResult VTable0x94(LegoPathActor*, MxBool) { return 0; } // vtable+0x94 + virtual MxResult HitActor(LegoPathActor*, MxBool) { return 0; } // vtable+0x94 virtual void SwitchBoundary( LegoPathBoundary*& p_boundary, diff --git a/LEGO1/lego/legoomni/include/legoraceactor.h b/LEGO1/lego/legoomni/include/legoraceactor.h index 0d759f36..9262f258 100644 --- a/LEGO1/lego/legoomni/include/legoraceactor.h +++ b/LEGO1/lego/legoomni/include/legoraceactor.h @@ -32,7 +32,7 @@ class LegoRaceActor : public virtual LegoAnimActor { MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68 MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 // FUNCTION: LEGO1 0x10014aa0 // FUNCTION: BETA10 0x100ca038 diff --git a/LEGO1/lego/legoomni/include/legoracers.h b/LEGO1/lego/legoomni/include/legoracers.h index 36601e27..c1aa721e 100644 --- a/LEGO1/lego/legoomni/include/legoracers.h +++ b/LEGO1/lego/legoomni/include/legoracers.h @@ -65,9 +65,9 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { float p_f1, float p_f2, Vector3& p_v3 - ) override; // vtable+0x6c - void VTable0x70(float p_time) override; // vtable+0x70 - MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 + ) override; // vtable+0x6c + void VTable0x70(float p_time) override; // vtable+0x70 + MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) override; // vtable+0x98 MxResult VTable0x9c() override; // vtable+0x9c diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index 42326b2c..af4bca85 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -103,7 +103,7 @@ void Act2Actor::FUN_10018980() // FUNCTION: LEGO1 0x100189f0 // FUNCTION: BETA10 0x1000ca64 -MxResult Act2Actor::VTable0x94(LegoPathActor*, MxBool) +MxResult Act2Actor::HitActor(LegoPathActor*, MxBool) { if (m_unk0x1f == FALSE) { m_unk0x1f = TRUE; @@ -117,7 +117,7 @@ MxResult Act2Actor::VTable0x94(LegoPathActor*, MxBool) // FUNCTION: LEGO1 0x10018a20 MxResult Act2Actor::VTable0x9c() { - if (m_grec && !(m_grec->m_flags & LegoPathEdgeContainer::c_bit1)) { + if (m_grec && !m_grec->GetBit1()) { delete m_grec; m_grec = NULL; return SUCCESS; diff --git a/LEGO1/lego/legoomni/src/actors/act2genactor.cpp b/LEGO1/lego/legoomni/src/actors/act2genactor.cpp index fa66335e..0a2ef3ba 100644 --- a/LEGO1/lego/legoomni/src/actors/act2genactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2genactor.cpp @@ -14,7 +14,7 @@ MxLong Act2GenActor::g_lastHitActorTime = 0; // FUNCTION: LEGO1 0x10018740 // FUNCTION: BETA10 0x1000c7a0 -MxResult Act2GenActor::VTable0x94(LegoPathActor* p_actor, MxBool) +MxResult Act2GenActor::HitActor(LegoPathActor* p_actor, MxBool) { MxLong time = Timer()->GetTime(); MxLong diff = time - g_lastHitActorTime; diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index 6d5491a3..c6a8d885 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -5,8 +5,11 @@ #include "define.h" #include "legocachesoundmanager.h" #include "legolocomotionanimpresenter.h" +#include "legopathedgecontainer.h" #include "legosoundmanager.h" #include "misc.h" +#include "mxmisc.h" +#include "mxtimer.h" #include "mxutilities.h" #include "roi/legoroi.h" @@ -76,7 +79,7 @@ MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform) } // FUNCTION: LEGO1 0x1003fd90 -MxResult Act3Actor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult Act3Actor::HitActor(LegoPathActor* p_actor, MxBool p_bool) { if (!p_actor->GetUserNavFlag() && p_bool) { if (p_actor->GetState()) { @@ -110,9 +113,10 @@ Act3Cop::Act3Cop() // FUNCTION: LEGO1 0x1003ff70 // FUNCTION: BETA10 0x10018526 -MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult Act3Cop::HitActor(LegoPathActor* p_actor, MxBool p_bool) { LegoROI* roi = p_actor->GetROI(); + if (p_bool && !strncmp(roi->GetName(), "dammo", 5)) { MxS32 count = -1; if (sscanf(roi->GetName(), "dammo%d", &count) != 1) { @@ -129,9 +133,9 @@ MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) FUN_10040360(); } else { - if (((Act3*) m_world)->GetBrickster()->GetROI() != roi) { + if (((Act3*) m_world)->m_brickster->GetROI() != roi) { if (p_bool) { - return Act3Actor::VTable0x94(p_actor, p_bool); + return Act3Actor::HitActor(p_actor, p_bool); } } else { @@ -162,11 +166,19 @@ void Act3Cop::FUN_10040360() // TODO } -// STUB: LEGO1 0x10040d20 +// FUNCTION: LEGO1 0x10040d20 +// FUNCTION: BETA10 0x1001942c MxResult Act3Cop::VTable0x9c() { - // TODO - return SUCCESS; + if (m_grec && !m_grec->GetBit1()) { + delete m_grec; + m_grec = NULL; + m_lastTime = Timer()->GetTime(); + FUN_10040360(); + return SUCCESS; + } + + return Act3Actor::VTable0x9c(); } // FUNCTION: LEGO1 0x10040e10 @@ -220,10 +232,39 @@ void Act3Brickster::VTable0x70(float p_time) // TODO } -// STUB: LEGO1 0x100416b0 -MxResult Act3Brickster::VTable0x94(LegoPathActor*, MxBool) +// FUNCTION: LEGO1 0x100416b0 +// FUNCTION: BETA10 0x1001a299 +MxResult Act3Brickster::HitActor(LegoPathActor* p_actor, MxBool p_bool) { - // TODO + if (!p_bool) { + return FAILURE; + } + + Act3* a3 = (Act3*) m_world; + LegoROI* r = p_actor->GetROI(); + assert(r); + + if (a3->m_cop1->GetROI() != r && a3->m_cop2->GetROI() != r) { + if (!strncmp(r->GetName(), "pammo", 5)) { + MxS32 count = -1; + if (sscanf(r->GetName(), "pammo%d", &count) != 1) { + assert(0); + } + + assert(m_world); + + if (a3->m_pizzas[count].IsValid() && !a3->m_pizzas[count].IsBit5()) { + a3->EatPizza(count); + } + + m_unk0x38 = 2; + return SUCCESS; + } + else { + return Act3Actor::HitActor(p_actor, p_bool); + } + } + return SUCCESS; } @@ -235,17 +276,27 @@ MxResult Act3Brickster::FUN_100417c0() return SUCCESS; } -// STUB: LEGO1 0x10042990 +// FUNCTION: LEGO1 0x10042990 +// FUNCTION: BETA10 0x1001b6e2 void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) { - // TODO + if (m_unk0x38 != 8) { + m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4); + } } -// STUB: LEGO1 0x100429d0 +// FUNCTION: LEGO1 0x100429d0 +// FUNCTION: BETA10 0x1001b75b MxResult Act3Brickster::VTable0x9c() { - // TODO - return SUCCESS; + if (m_grec && !m_grec->GetBit1()) { + delete m_grec; + m_grec = NULL; + m_lastTime = Timer()->GetTime(); + return SUCCESS; + } + + return Act3Actor::VTable0x9c(); } // FUNCTION: LEGO1 0x10042ab0 diff --git a/LEGO1/lego/legoomni/src/actors/doors.cpp b/LEGO1/lego/legoomni/src/actors/doors.cpp index 1dff3758..61949049 100644 --- a/LEGO1/lego/legoomni/src/actors/doors.cpp +++ b/LEGO1/lego/legoomni/src/actors/doors.cpp @@ -24,7 +24,7 @@ MxFloat g_unk0x100d8e84 = 6000.0f; // FUNCTION: LEGO1 0x10066100 // FUNCTION: BETA10 0x10026850 -MxResult Doors::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult Doors::HitActor(LegoPathActor* p_actor, MxBool p_bool) { assert(m_ltDoor && m_rtDoor); diff --git a/LEGO1/lego/legoomni/src/entity/act2brick.cpp b/LEGO1/lego/legoomni/src/entity/act2brick.cpp index c308912c..4ffac19c 100644 --- a/LEGO1/lego/legoomni/src/entity/act2brick.cpp +++ b/LEGO1/lego/legoomni/src/entity/act2brick.cpp @@ -107,7 +107,7 @@ void Act2Brick::FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBou } // FUNCTION: LEGO1 0x1007a750 -MxResult Act2Brick::VTable0x94(LegoPathActor* p_actor, MxBool) +MxResult Act2Brick::HitActor(LegoPathActor* p_actor, MxBool) { MxLong time = Timer()->GetTime(); MxLong diff = time - g_lastHitActorTime; diff --git a/LEGO1/lego/legoomni/src/entity/legojetski.cpp b/LEGO1/lego/legoomni/src/entity/legojetski.cpp index ef1c36c0..d1d671f3 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetski.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetski.cpp @@ -56,7 +56,7 @@ MxLong LegoJetski::Notify(MxParam& p_param) } // STUB: LEGO1 0x10013c40 -MxResult LegoJetski::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool) { // TODO return 0; diff --git a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp index 8b39ebbb..65e7223d 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp @@ -168,9 +168,9 @@ MxU32 LegoJetskiRaceActor::VTable0x6c( if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) { - VTable0x94(actor, TRUE); + HitActor(actor, TRUE); - if (actor->VTable0x94(this, FALSE) < 0) { + if (actor->HitActor(this, FALSE) < 0) { return 0; } else { diff --git a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp index ebfd17d3..959481b2 100644 --- a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp @@ -190,7 +190,7 @@ inline void LegoExtraActor::FUN_1002ad8a() } // FUNCTION: LEGO1 0x1002aba0 -MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool) { if (p_actor->GetState() != 0 || m_state != 0) { return FAILURE; @@ -497,11 +497,11 @@ MxU32 LegoExtraActor::VTable0x6c( (local20X <= -0.01 && p_f1 + 0.01 <= local1cX)) { p_v3 = p_v1; - if (VTable0x94(actor, TRUE) < 0) { + if (HitActor(actor, TRUE) < 0) { return 0; } - actor->VTable0x94(this, FALSE); + actor->HitActor(this, FALSE); return 2; } } @@ -509,11 +509,11 @@ MxU32 LegoExtraActor::VTable0x6c( } else { if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) { - if (VTable0x94(actor, TRUE) < 0) { + if (HitActor(actor, TRUE) < 0) { return 0; } - actor->VTable0x94(this, FALSE); + actor->HitActor(this, FALSE); return 2; } } diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index e64029eb..feb1a329 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -463,8 +463,8 @@ MxU32 LegoPathActor::VTable0x6c( if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->m_collideBox)) { - VTable0x94(actor, TRUE); - actor->VTable0x94(this, FALSE); + HitActor(actor, TRUE); + actor->HitActor(this, FALSE); return 2; } } diff --git a/LEGO1/lego/legoomni/src/race/legoraceactor.cpp b/LEGO1/lego/legoomni/src/race/legoraceactor.cpp index c0462c6c..99d01f47 100644 --- a/LEGO1/lego/legoomni/src/race/legoraceactor.cpp +++ b/LEGO1/lego/legoomni/src/race/legoraceactor.cpp @@ -95,7 +95,7 @@ MxU32 LegoRaceActor::VTable0x90(float p_time, Matrix4& p_transform) // FUNCTION: LEGO1 0x10014a00 // FUNCTION: BETA10 0x100c9f5c -MxResult LegoRaceActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult LegoRaceActor::HitActor(LegoPathActor* p_actor, MxBool p_bool) { if (!p_actor->GetUserNavFlag()) { if (p_actor->GetState()) { @@ -115,5 +115,6 @@ MxResult LegoRaceActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) p_actor->SetState(2); } } - return 0; + + return SUCCESS; } diff --git a/LEGO1/lego/legoomni/src/race/legoracers.cpp b/LEGO1/lego/legoomni/src/race/legoracers.cpp index 306179db..d665b73f 100644 --- a/LEGO1/lego/legoomni/src/race/legoracers.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracers.cpp @@ -428,7 +428,7 @@ void LegoRaceCar::VTable0x70(float p_time) // FUNCTION: LEGO1 0x100133c0 // FUNCTION: BETA10 0x100cbb84 -MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) +MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool) { // Note: Code duplication with LegoRaceActor::VTable0x94 if (!p_actor->GetUserNavFlag()) { @@ -499,6 +499,7 @@ MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) return FAILURE; } } + return SUCCESS; } diff --git a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp index c423726d..e680e878 100644 --- a/LEGO1/lego/legoomni/src/race/legoracespecial.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracespecial.cpp @@ -333,9 +333,9 @@ MxU32 LegoCarRaceActor::VTable0x6c( p_v3, m_collideBox && actor->GetCollideBox() )) { - VTable0x94(actor, TRUE); + HitActor(actor, TRUE); - if (actor->VTable0x94(this, FALSE) < 0) { + if (actor->HitActor(this, FALSE) < 0) { return 0; } else { @@ -353,9 +353,9 @@ MxU32 LegoCarRaceActor::VTable0x6c( p_v3, m_collideBox && actor->GetCollideBox() )) { - VTable0x94(actor, TRUE); + HitActor(actor, TRUE); - if (actor->VTable0x94(this, FALSE) < 0) { + if (actor->HitActor(this, FALSE) < 0) { return 0; } else { @@ -366,8 +366,9 @@ MxU32 LegoCarRaceActor::VTable0x6c( } else { if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) { - VTable0x94(actor, TRUE); - if (actor->VTable0x94(this, FALSE) < 0) { + HitActor(actor, TRUE); + + if (actor->HitActor(this, FALSE) < 0) { return 0; } else { diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 6a37d24f..3cfa4cf7 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -180,6 +180,14 @@ Act3::~Act3() TickleManager()->UnregisterClient(this); } +// FUNCTION: LEGO1 0x10072780 +// FUNCTION: BETA10 0x100156ac +void Act3::EatPizza(MxS32 p_index) +{ + assert(p_index < MAX_PIZZAS); + RemovePizza(m_pizzas[p_index]); +} + // FUNCTION: LEGO1 0x100727a0 // FUNCTION: BETA10 0x1001570d void Act3::EatDonut(MxS32 p_index) @@ -188,6 +196,25 @@ void Act3::EatDonut(MxS32 p_index) RemoveDonut(m_donuts[p_index]); } +// FUNCTION: LEGO1 0x100727c0 +// FUNCTION: BETA10 0x1001576e +void Act3::RemovePizza(Act3Ammo& p_p) +{ +#ifdef _DEBUG + MxS32 i; + for (i = 0; i < MAX_PIZZAS; i++) { + if (&m_pizzas[i] == &p_p) { + break; + } + } + + assert(i != MAX_PIZZAS); +#endif + + assert(p_p.IsValid()); + p_p.Remove(); +} + // FUNCTION: LEGO1 0x100727d0 // FUNCTION: BETA10 0x10015828 void Act3::RemoveDonut(Act3Ammo& p_p) @@ -534,8 +561,8 @@ MxResult Act3::Tickle() return SUCCESS; } -// STUB: LEGO1 0x100733f0 -// STUB: BETA10 0x10016ba2 +// FUNCTION: LEGO1 0x100733f0 +// FUNCTION: BETA10 0x10016ba2 void Act3::SetBrickster(Act3Brickster* p_brickster) { m_brickster = p_brickster;