Implement/match Act3Brickster::HitActor (#1212)

* Implement/match `Act3Brickster::HitActor`

* Fixes

* Fixes

* Fixes

* Add `Act3Cop::VTable0x9c`

* Fix
This commit is contained in:
Christian Semmler 2024-12-12 09:10:44 -07:00 committed by GitHub
parent fe57a94416
commit aceba71fbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 166 additions and 78 deletions

View file

@ -23,7 +23,7 @@ class Act2Actor : public LegoAnimActor {
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30 void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68 MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68
void VTable0x70(float p_time) override; // vtable+0x70 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 MxResult VTable0x9c() override; // vtable+0x9c
MxS32 VTable0xa0() override; // vtable+0xa0 MxS32 VTable0xa0() override; // vtable+0xa0

View file

@ -26,7 +26,7 @@ class Act2Brick : public LegoPathActor {
return !strcmp(p_name, Act2Brick::ClassName()) || LegoEntity::IsA(p_name); 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 // SYNTHETIC: LEGO1 0x1007a450
// Act2Brick::`scalar deleting destructor' // Act2Brick::`scalar deleting destructor'

View file

@ -6,7 +6,7 @@
// VTABLE: LEGO1 0x100d4ed8 // VTABLE: LEGO1 0x100d4ed8
// SIZE 0x154 // SIZE 0x154
class Act2GenActor : public LegoPathActor { 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 // SYNTHETIC: LEGO1 0x1000f5a0
// Act2GenActor::`scalar deleting destructor' // Act2GenActor::`scalar deleting destructor'

View file

@ -113,12 +113,12 @@ class Act3 : public LegoWorld {
void SetShark(Act3Shark* p_shark) { m_shark = p_shark; } void SetShark(Act3Shark* p_shark) { m_shark = p_shark; }
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
Act3Brickster* GetBrickster() { return m_brickster; }
// SYNTHETIC: LEGO1 0x10072630 // SYNTHETIC: LEGO1 0x10072630
// Act3::`scalar deleting destructor' // Act3::`scalar deleting destructor'
void EatPizza(MxS32 p_index);
void EatDonut(MxS32 p_index); void EatDonut(MxS32 p_index);
void RemovePizza(Act3Ammo& p_p);
void RemoveDonut(Act3Ammo& p_p); void RemoveDonut(Act3Ammo& p_p);
MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); 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); 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); void GoodEnding(const Matrix4& p_matrix);
static void DebugPrintf(const char* p_format, ...); 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: protected:
MxLong HandleTransitionEnd(); MxLong HandleTransitionEnd();

View file

@ -23,8 +23,8 @@ class Act3Actor : public LegoAnimActor {
return "Act3Actor"; return "Act3Actor";
} }
MxU32 VTable0x90(float p_time, Matrix4& p_transform) override; // vtable+0x90 MxU32 VTable0x90(float p_time, Matrix4& p_transform) 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
MxFloat GetUnknown0x1c() { return m_unk0x1c; } MxFloat GetUnknown0x1c() { return m_unk0x1c; }
@ -37,9 +37,9 @@ class Act3Actor : public LegoAnimActor {
// Act3Actor::~Act3Actor // Act3Actor::~Act3Actor
private: private:
MxFloat m_unk0x1c; // 0x1c
static Mx3DPointFloat g_unk0x10104ef0; static Mx3DPointFloat g_unk0x10104ef0;
MxFloat m_unk0x1c; // 0x1c
}; };
// VTABLE: LEGO1 0x100d7750 LegoPathActor // VTABLE: LEGO1 0x100d7750 LegoPathActor
@ -49,10 +49,10 @@ class Act3Cop : public Act3Actor {
public: public:
Act3Cop(); Act3Cop();
void ParseAction(char* p_extra) override; // vtable+0x20 void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_time) override; // vtable+0x70 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 MxResult VTable0x9c() override; // vtable+0x9c
MxFloat GetUnknown0x20() { return m_unk0x20; } MxFloat GetUnknown0x20() { return m_unk0x20; }
@ -66,7 +66,7 @@ class Act3Cop : public Act3Actor {
private: private:
MxFloat m_unk0x20; // 0x20 MxFloat m_unk0x20; // 0x20
LegoWorld* m_world; // 0x24 LegoWorld* m_world; // 0x24
undefined4 m_unk0x24[2]; // 0x28 undefined4 m_unk0x28[2]; // 0x28
}; };
// VTABLE: LEGO1 0x100d7838 LegoPathActor // VTABLE: LEGO1 0x100d7838 LegoPathActor
@ -77,9 +77,9 @@ class Act3Brickster : public Act3Actor {
Act3Brickster(); Act3Brickster();
~Act3Brickster() override; ~Act3Brickster() override;
void ParseAction(char* p_extra) override; // vtable+0x20 void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_time) override; // vtable+0x70 void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary( void SwitchBoundary(
LegoPathBoundary*& p_boundary, LegoPathBoundary*& p_boundary,
LegoUnknown100db7f4*& p_edge, LegoUnknown100db7f4*& p_edge,

View file

@ -68,6 +68,8 @@ class Act3Ammo : public LegoPathActor {
} }
} }
MxU32 IsBit5() { return m_ammoFlag & c_bit5; }
MxFloat GetUnknown0x158() { return m_unk0x158; } MxFloat GetUnknown0x158() { return m_unk0x158; }
void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; } void SetUnknown0x158(MxFloat p_unk0x158) { m_unk0x158 = p_unk0x158; }

View file

@ -24,10 +24,10 @@ class Doors : public LegoPathActor {
return !strcmp(p_name, Doors::ClassName()) || LegoPathActor::IsA(p_name); return !strcmp(p_name, Doors::ClassName()) || LegoPathActor::IsA(p_name);
} }
void ParseAction(char* p_extra) override; // vtable+0x20 void ParseAction(char* p_extra) override; // vtable+0x20
void VTable0x70(float p_time) override; // vtable+0x70 void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc virtual MxFloat VTable0xcc(float p_time); // vtable+0xcc
// SYNTHETIC: LEGO1 0x1000e580 // SYNTHETIC: LEGO1 0x1000e580
// Doors::`scalar deleting destructor' // Doors::`scalar deleting destructor'

View file

@ -42,14 +42,14 @@ class LegoExtraActor : public virtual LegoAnimActor {
float p_f1, float p_f1,
float p_f2, float p_f2,
Vector3& p_v3 Vector3& p_v3
) override; // vtable+0x6c ) override; // vtable+0x6c
void VTable0x70(float p_time) override; // vtable+0x70 void VTable0x70(float p_time) override; // vtable+0x70
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74 void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90 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
MxResult VTable0x9c() override; // vtable+0x9c MxResult VTable0x9c() override; // vtable+0x9c
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4 void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4
void VTable0xc4() override; // vtable+0xc4 void VTable0xc4() override; // vtable+0xc4
virtual MxResult FUN_1002aae0(); virtual MxResult FUN_1002aae0();

View file

@ -39,9 +39,9 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {
float p_f1, float p_f1,
float p_f2, float p_f2,
Vector3& p_v3 Vector3& p_v3
) override; // vtable+0x6c ) override; // vtable+0x6c
void VTable0x70(float p_time) override; // vtable+0x70 void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98 override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c MxResult VTable0x9c() override; // vtable+0x9c

View file

@ -91,7 +91,7 @@ class LegoPathActor : public LegoActor {
virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90 virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
// FUNCTION: LEGO1 0x10002d50 // FUNCTION: LEGO1 0x10002d50
virtual MxResult VTable0x94(LegoPathActor*, MxBool) { return 0; } // vtable+0x94 virtual MxResult HitActor(LegoPathActor*, MxBool) { return 0; } // vtable+0x94
virtual void SwitchBoundary( virtual void SwitchBoundary(
LegoPathBoundary*& p_boundary, LegoPathBoundary*& p_boundary,

View file

@ -32,7 +32,7 @@ class LegoRaceActor : public virtual LegoAnimActor {
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68 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 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: LEGO1 0x10014aa0
// FUNCTION: BETA10 0x100ca038 // FUNCTION: BETA10 0x100ca038

View file

@ -65,9 +65,9 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
float p_f1, float p_f1,
float p_f2, float p_f2,
Vector3& p_v3 Vector3& p_v3
) override; // vtable+0x6c ) override; // vtable+0x6c
void VTable0x70(float p_time) override; // vtable+0x70 void VTable0x70(float p_time) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94 MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98 override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c MxResult VTable0x9c() override; // vtable+0x9c

View file

@ -103,7 +103,7 @@ void Act2Actor::FUN_10018980()
// FUNCTION: LEGO1 0x100189f0 // FUNCTION: LEGO1 0x100189f0
// FUNCTION: BETA10 0x1000ca64 // FUNCTION: BETA10 0x1000ca64
MxResult Act2Actor::VTable0x94(LegoPathActor*, MxBool) MxResult Act2Actor::HitActor(LegoPathActor*, MxBool)
{ {
if (m_unk0x1f == FALSE) { if (m_unk0x1f == FALSE) {
m_unk0x1f = TRUE; m_unk0x1f = TRUE;
@ -117,7 +117,7 @@ MxResult Act2Actor::VTable0x94(LegoPathActor*, MxBool)
// FUNCTION: LEGO1 0x10018a20 // FUNCTION: LEGO1 0x10018a20
MxResult Act2Actor::VTable0x9c() MxResult Act2Actor::VTable0x9c()
{ {
if (m_grec && !(m_grec->m_flags & LegoPathEdgeContainer::c_bit1)) { if (m_grec && !m_grec->GetBit1()) {
delete m_grec; delete m_grec;
m_grec = NULL; m_grec = NULL;
return SUCCESS; return SUCCESS;

View file

@ -14,7 +14,7 @@ MxLong Act2GenActor::g_lastHitActorTime = 0;
// FUNCTION: LEGO1 0x10018740 // FUNCTION: LEGO1 0x10018740
// FUNCTION: BETA10 0x1000c7a0 // FUNCTION: BETA10 0x1000c7a0
MxResult Act2GenActor::VTable0x94(LegoPathActor* p_actor, MxBool) MxResult Act2GenActor::HitActor(LegoPathActor* p_actor, MxBool)
{ {
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
MxLong diff = time - g_lastHitActorTime; MxLong diff = time - g_lastHitActorTime;

View file

@ -5,8 +5,11 @@
#include "define.h" #include "define.h"
#include "legocachesoundmanager.h" #include "legocachesoundmanager.h"
#include "legolocomotionanimpresenter.h" #include "legolocomotionanimpresenter.h"
#include "legopathedgecontainer.h"
#include "legosoundmanager.h" #include "legosoundmanager.h"
#include "misc.h" #include "misc.h"
#include "mxmisc.h"
#include "mxtimer.h"
#include "mxutilities.h" #include "mxutilities.h"
#include "roi/legoroi.h" #include "roi/legoroi.h"
@ -76,7 +79,7 @@ MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform)
} }
// FUNCTION: LEGO1 0x1003fd90 // 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->GetUserNavFlag() && p_bool) {
if (p_actor->GetState()) { if (p_actor->GetState()) {
@ -110,9 +113,10 @@ Act3Cop::Act3Cop()
// FUNCTION: LEGO1 0x1003ff70 // FUNCTION: LEGO1 0x1003ff70
// FUNCTION: BETA10 0x10018526 // 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(); LegoROI* roi = p_actor->GetROI();
if (p_bool && !strncmp(roi->GetName(), "dammo", 5)) { if (p_bool && !strncmp(roi->GetName(), "dammo", 5)) {
MxS32 count = -1; MxS32 count = -1;
if (sscanf(roi->GetName(), "dammo%d", &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(); FUN_10040360();
} }
else { else {
if (((Act3*) m_world)->GetBrickster()->GetROI() != roi) { if (((Act3*) m_world)->m_brickster->GetROI() != roi) {
if (p_bool) { if (p_bool) {
return Act3Actor::VTable0x94(p_actor, p_bool); return Act3Actor::HitActor(p_actor, p_bool);
} }
} }
else { else {
@ -162,11 +166,19 @@ void Act3Cop::FUN_10040360()
// TODO // TODO
} }
// STUB: LEGO1 0x10040d20 // FUNCTION: LEGO1 0x10040d20
// FUNCTION: BETA10 0x1001942c
MxResult Act3Cop::VTable0x9c() MxResult Act3Cop::VTable0x9c()
{ {
// TODO if (m_grec && !m_grec->GetBit1()) {
return SUCCESS; delete m_grec;
m_grec = NULL;
m_lastTime = Timer()->GetTime();
FUN_10040360();
return SUCCESS;
}
return Act3Actor::VTable0x9c();
} }
// FUNCTION: LEGO1 0x10040e10 // FUNCTION: LEGO1 0x10040e10
@ -220,10 +232,39 @@ void Act3Brickster::VTable0x70(float p_time)
// TODO // TODO
} }
// STUB: LEGO1 0x100416b0 // FUNCTION: LEGO1 0x100416b0
MxResult Act3Brickster::VTable0x94(LegoPathActor*, MxBool) // 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; return SUCCESS;
} }
@ -235,17 +276,27 @@ MxResult Act3Brickster::FUN_100417c0()
return SUCCESS; return SUCCESS;
} }
// STUB: LEGO1 0x10042990 // FUNCTION: LEGO1 0x10042990
// FUNCTION: BETA10 0x1001b6e2
void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) 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() MxResult Act3Brickster::VTable0x9c()
{ {
// TODO if (m_grec && !m_grec->GetBit1()) {
return SUCCESS; delete m_grec;
m_grec = NULL;
m_lastTime = Timer()->GetTime();
return SUCCESS;
}
return Act3Actor::VTable0x9c();
} }
// FUNCTION: LEGO1 0x10042ab0 // FUNCTION: LEGO1 0x10042ab0

View file

@ -24,7 +24,7 @@ MxFloat g_unk0x100d8e84 = 6000.0f;
// FUNCTION: LEGO1 0x10066100 // FUNCTION: LEGO1 0x10066100
// FUNCTION: BETA10 0x10026850 // 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); assert(m_ltDoor && m_rtDoor);

View file

@ -107,7 +107,7 @@ void Act2Brick::FUN_1007a670(MxMatrix& p_param1, MxMatrix& p_param2, LegoPathBou
} }
// FUNCTION: LEGO1 0x1007a750 // FUNCTION: LEGO1 0x1007a750
MxResult Act2Brick::VTable0x94(LegoPathActor* p_actor, MxBool) MxResult Act2Brick::HitActor(LegoPathActor* p_actor, MxBool)
{ {
MxLong time = Timer()->GetTime(); MxLong time = Timer()->GetTime();
MxLong diff = time - g_lastHitActorTime; MxLong diff = time - g_lastHitActorTime;

View file

@ -56,7 +56,7 @@ MxLong LegoJetski::Notify(MxParam& p_param)
} }
// STUB: LEGO1 0x10013c40 // STUB: LEGO1 0x10013c40
MxResult LegoJetski::VTable0x94(LegoPathActor* p_actor, MxBool p_bool) MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
{ {
// TODO // TODO
return 0; return 0;

View file

@ -168,9 +168,9 @@ MxU32 LegoJetskiRaceActor::VTable0x6c(
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { 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())) { 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; return 0;
} }
else { else {

View file

@ -190,7 +190,7 @@ inline void LegoExtraActor::FUN_1002ad8a()
} }
// FUNCTION: LEGO1 0x1002aba0 // 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) { if (p_actor->GetState() != 0 || m_state != 0) {
return FAILURE; return FAILURE;
@ -497,11 +497,11 @@ MxU32 LegoExtraActor::VTable0x6c(
(local20X <= -0.01 && p_f1 + 0.01 <= local1cX)) { (local20X <= -0.01 && p_f1 + 0.01 <= local1cX)) {
p_v3 = p_v1; p_v3 = p_v1;
if (VTable0x94(actor, TRUE) < 0) { if (HitActor(actor, TRUE) < 0) {
return 0; return 0;
} }
actor->VTable0x94(this, FALSE); actor->HitActor(this, FALSE);
return 2; return 2;
} }
} }
@ -509,11 +509,11 @@ MxU32 LegoExtraActor::VTable0x6c(
} }
else { else {
if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) { 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; return 0;
} }
actor->VTable0x94(this, FALSE); actor->HitActor(this, FALSE);
return 2; return 2;
} }
} }

View file

@ -463,8 +463,8 @@ MxU32 LegoPathActor::VTable0x6c(
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { 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)) { if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->m_collideBox)) {
VTable0x94(actor, TRUE); HitActor(actor, TRUE);
actor->VTable0x94(this, FALSE); actor->HitActor(this, FALSE);
return 2; return 2;
} }
} }

View file

@ -95,7 +95,7 @@ MxU32 LegoRaceActor::VTable0x90(float p_time, Matrix4& p_transform)
// FUNCTION: LEGO1 0x10014a00 // FUNCTION: LEGO1 0x10014a00
// FUNCTION: BETA10 0x100c9f5c // 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->GetUserNavFlag()) {
if (p_actor->GetState()) { if (p_actor->GetState()) {
@ -115,5 +115,6 @@ MxResult LegoRaceActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
p_actor->SetState(2); p_actor->SetState(2);
} }
} }
return 0;
return SUCCESS;
} }

View file

@ -428,7 +428,7 @@ void LegoRaceCar::VTable0x70(float p_time)
// FUNCTION: LEGO1 0x100133c0 // FUNCTION: LEGO1 0x100133c0
// FUNCTION: BETA10 0x100cbb84 // 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 // Note: Code duplication with LegoRaceActor::VTable0x94
if (!p_actor->GetUserNavFlag()) { if (!p_actor->GetUserNavFlag()) {
@ -499,6 +499,7 @@ MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
return FAILURE; return FAILURE;
} }
} }
return SUCCESS; return SUCCESS;
} }

View file

@ -333,9 +333,9 @@ MxU32 LegoCarRaceActor::VTable0x6c(
p_v3, p_v3,
m_collideBox && actor->GetCollideBox() m_collideBox && actor->GetCollideBox()
)) { )) {
VTable0x94(actor, TRUE); HitActor(actor, TRUE);
if (actor->VTable0x94(this, FALSE) < 0) { if (actor->HitActor(this, FALSE) < 0) {
return 0; return 0;
} }
else { else {
@ -353,9 +353,9 @@ MxU32 LegoCarRaceActor::VTable0x6c(
p_v3, p_v3,
m_collideBox && actor->GetCollideBox() m_collideBox && actor->GetCollideBox()
)) { )) {
VTable0x94(actor, TRUE); HitActor(actor, TRUE);
if (actor->VTable0x94(this, FALSE) < 0) { if (actor->HitActor(this, FALSE) < 0) {
return 0; return 0;
} }
else { else {
@ -366,8 +366,9 @@ MxU32 LegoCarRaceActor::VTable0x6c(
} }
else { else {
if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) { 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; return 0;
} }
else { else {

View file

@ -180,6 +180,14 @@ Act3::~Act3()
TickleManager()->UnregisterClient(this); 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: LEGO1 0x100727a0
// FUNCTION: BETA10 0x1001570d // FUNCTION: BETA10 0x1001570d
void Act3::EatDonut(MxS32 p_index) void Act3::EatDonut(MxS32 p_index)
@ -188,6 +196,25 @@ void Act3::EatDonut(MxS32 p_index)
RemoveDonut(m_donuts[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: LEGO1 0x100727d0
// FUNCTION: BETA10 0x10015828 // FUNCTION: BETA10 0x10015828
void Act3::RemoveDonut(Act3Ammo& p_p) void Act3::RemoveDonut(Act3Ammo& p_p)
@ -534,8 +561,8 @@ MxResult Act3::Tickle()
return SUCCESS; return SUCCESS;
} }
// STUB: LEGO1 0x100733f0 // FUNCTION: LEGO1 0x100733f0
// STUB: BETA10 0x10016ba2 // FUNCTION: BETA10 0x10016ba2
void Act3::SetBrickster(Act3Brickster* p_brickster) void Act3::SetBrickster(Act3Brickster* p_brickster)
{ {
m_brickster = p_brickster; m_brickster = p_brickster;