From b17d76c2cc73c0d8b9a89ce9112aa9936eb1f18c Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:27:17 +0200 Subject: [PATCH] Refactor: Replace magic values by enum values (#865) Co-authored-by: jonschz --- LEGO1/lego/legoomni/src/actors/radio.cpp | 2 +- LEGO1/lego/legoomni/src/common/legogamestate.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/radio.cpp b/LEGO1/lego/legoomni/src/actors/radio.cpp index e21a399f..5aaea1ab 100644 --- a/LEGO1/lego/legoomni/src/actors/radio.cpp +++ b/LEGO1/lego/legoomni/src/actors/radio.cpp @@ -80,7 +80,7 @@ void Radio::Stop() if (m_state->IsActive()) { LegoWorld* world = CurrentWorld(); - MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtom(), 18); + MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtom(), IsleScript::c_Radio_Ctl); if (presenter) { presenter->VTable0x6c(0); diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 9ef5b33a..3fedc6c4 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -1083,28 +1083,28 @@ void LegoGameState::Init() if (m_loadedAct == e_act1) { Isle* isle = (Isle*) FindWorld(*g_isleScript, 0); - Helicopter* copter = (Helicopter*) isle->Find(*g_copterScript, 1); + Helicopter* copter = (Helicopter*) isle->Find(*g_copterScript, CopterScript::c_Helicopter_Actor); if (copter) { isle->FUN_1001fc80(copter); isle->VTable0x6c(copter); delete copter; } - DuneBuggy* dunebuggy = (DuneBuggy*) isle->Find(*g_dunecarScript, 2); + DuneBuggy* dunebuggy = (DuneBuggy*) isle->Find(*g_dunecarScript, DunecarScript::c_DuneBugy_Actor); if (dunebuggy) { isle->FUN_1001fc80(dunebuggy); isle->VTable0x6c(dunebuggy); delete dunebuggy; } - Jetski* jetski = (Jetski*) isle->Find(*g_jetskiScript, 3); + Jetski* jetski = (Jetski*) isle->Find(*g_jetskiScript, JetskiScript::c_Jetski_Actor); if (jetski) { isle->FUN_1001fc80(jetski); isle->VTable0x6c(jetski); delete jetski; } - RaceCar* racecar = (RaceCar*) isle->Find(*g_racecarScript, 4); + RaceCar* racecar = (RaceCar*) isle->Find(*g_racecarScript, RacecarScript::c_RaceCar_Actor); if (racecar) { isle->FUN_1001fc80(racecar); isle->VTable0x6c(racecar);