Cast LegoWorld* to Act3*

This commit is contained in:
disinvite 2024-12-11 16:13:41 -05:00
parent 717db3a93f
commit fc01b3c93e
2 changed files with 7 additions and 5 deletions

View File

@ -1,9 +1,10 @@
#ifndef ACT3COP_H
#define ACT3COP_H
#include "act3.h"
#include "act3actors.h"
class LegoWorld;
// VTABLE: LEGO1 0x100d7750 LegoPathActor
// VTABLE: LEGO1 0x100d7820 LegoAnimActor
// SIZE 0x188
@ -27,7 +28,7 @@ class Act3Cop : public Act3Actor {
private:
MxFloat m_unk0x20; // 0x20
Act3* m_world; // 0x24
LegoWorld* m_world; // 0x24
undefined4 m_unk0x24[2]; // 0x28
};

View File

@ -1,5 +1,6 @@
#include "act3cop.h"
#include "act3.h"
#include "act3brickster.h"
#include "legocachesoundmanager.h"
#include "legosoundmanager.h"
@ -28,7 +29,7 @@ MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
assert(m_world);
m_world->EatDonut(count);
((Act3*) m_world)->EatDonut(count);
m_unk0x20 = m_lastTime + 2000;
SetWorldSpeed(6.0);
@ -37,13 +38,13 @@ MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
FUN_10040360();
}
else {
if (m_world->GetBrickster()->GetROI() != roi) {
if (((Act3*) m_world)->GetBrickster()->GetROI() != roi) {
if (p_bool) {
return Act3Actor::VTable0x94(p_actor, p_bool);
}
}
else {
m_world->GoodEnding(roi->GetLocal2World());
((Act3*) m_world)->GoodEnding(roi->GetLocal2World());
}
}