From 9c15e01e8af8b830b4f27f4edcefd1335c49f4c6 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Fri, 29 Mar 2024 13:43:33 -0400 Subject: [PATCH] RaceStandsEntity::VTable0x50 --- .../lego/legoomni/include/racestandsentity.h | 3 +- .../legoomni/src/race/racestandsentity.cpp | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/include/racestandsentity.h b/LEGO1/lego/legoomni/include/racestandsentity.h index 61c70bd0..22bc4dd2 100644 --- a/LEGO1/lego/legoomni/include/racestandsentity.h +++ b/LEGO1/lego/legoomni/include/racestandsentity.h @@ -19,8 +19,7 @@ class RaceStandsEntity : public BuildingEntity { return !strcmp(p_name, RaceStandsEntity::ClassName()) || BuildingEntity::IsA(p_name); } - // STUB: LEGO1 0x10015450 - MxLong VTable0x50(MxParam& p_param) override { return 0; } + MxLong VTable0x50(MxParam& p_param) override; // SYNTHETIC: LEGO1 0x1000f9e0 // RaceStandsEntity::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/race/racestandsentity.cpp b/LEGO1/lego/legoomni/src/race/racestandsentity.cpp index 8b4b7be5..b063e9f0 100644 --- a/LEGO1/lego/legoomni/src/race/racestandsentity.cpp +++ b/LEGO1/lego/legoomni/src/race/racestandsentity.cpp @@ -1,3 +1,36 @@ #include "racestandsentity.h" +#include "act1state.h" +#include "isle.h" +#include "isle_actions.h" +#include "islepathactor.h" +#include "legoanimationmanager.h" +#include "legogamestate.h" +#include "legoomni.h" +#include "legoutils.h" +#include "legoworld.h" +#include "misc.h" +#include "mxtransitionmanager.h" + DECOMP_SIZE_ASSERT(RaceStandsEntity, 0x68) + +// FUNCTION: LEGO1 0x10015450 +MxLong RaceStandsEntity::VTable0x50(MxParam& p_param) +{ + if (FUN_1003ef60()) { + Act1State* state = (Act1State*) GameState()->GetState("Act1State"); + state->SetUnknown18(0); + + if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { + CurrentActor()->VTable0xe4(); + } + + Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); + isle->SetDestLocation(LegoGameState::Area::e_racecarbuild); + + AnimationManager()->FUN_10061010(NULL); + TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); + } + + return 1; +} \ No newline at end of file