diff --git a/LEGO1/lego/legoomni/include/legonamedplane.h b/LEGO1/lego/legoomni/include/legonamedplane.h index 89497b31..0e75fe41 100644 --- a/LEGO1/lego/legoomni/include/legonamedplane.h +++ b/LEGO1/lego/legoomni/include/legonamedplane.h @@ -27,6 +27,10 @@ struct LegoNamedPlane { void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; } void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; } + // TODO: Unclear whether this was defined + MxBool IsPresent() { return strcmp(m_name.GetData(), "") != 0; } + void Reset() { m_name = ""; } + // FUNCTION: LEGO1 0x100344d0 MxResult Serialize(LegoStorage* p_storage) { diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index 62e410ac..65a0dc69 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -1165,7 +1165,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param) } gameState->m_helicopter = (Helicopter*) entity; - gameState->m_helicopterPlane.m_name = ""; + gameState->m_helicopterPlane.Reset(); break; case LegoGameState::e_dunecarbuild: if (gameState->m_dunebuggy) { @@ -1173,7 +1173,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param) } gameState->m_dunebuggy = (DuneBuggy*) entity; - gameState->m_dunebuggyPlane.m_name = ""; + gameState->m_dunebuggyPlane.Reset(); break; case LegoGameState::e_jetskibuild: if (gameState->m_jetski) { @@ -1181,7 +1181,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param) } gameState->m_jetski = (Jetski*) entity; - gameState->m_jetskiPlane.m_name = ""; + gameState->m_jetskiPlane.Reset(); break; case LegoGameState::e_racecarbuild: if (gameState->m_racecar) { @@ -1189,7 +1189,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param) } gameState->m_racecar = (RaceCar*) entity; - gameState->m_racecarPlane.m_name = ""; + gameState->m_racecarPlane.Reset(); break; } diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index 4efaea03..69a624ee 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -752,7 +752,7 @@ void LegoPathActor::UpdatePlane(LegoNamedPlane& p_namedPlane) // FUNCTION: LEGO1 0x1002f830 void LegoPathActor::PlaceActor(LegoNamedPlane& p_namedPlane) { - if (strcmp(p_namedPlane.m_name.GetData(), "")) { + if (p_namedPlane.IsPresent()) { LegoWorld* world = CurrentWorld(); world->PlaceActor(this, p_namedPlane.GetName(), 0, 0.5f, 1, 0.5f); SetLocation(p_namedPlane.GetPosition(), p_namedPlane.GetDirection(), p_namedPlane.GetUp(), TRUE); diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index f9eceae7..d3453817 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -1615,21 +1615,21 @@ void Act1State::PlaceActors() { Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); - if (strcmp(m_motocyclePlane.m_name.GetData(), "")) { + if (m_motocyclePlane.IsPresent()) { isle->m_motocycle->PlaceActor(m_motocyclePlane); } else { isle->PlaceActor(isle->m_motocycle, "INT43", 4, 0.5f, 1, 0.5f); } - if (strcmp(m_bikePlane.m_name.GetData(), "")) { + if (m_bikePlane.IsPresent()) { isle->m_bike->PlaceActor(m_bikePlane); } else { isle->PlaceActor(isle->m_bike, "INT44", 2, 0.5f, 0, 0.5f); } - if (strcmp(m_skateboardPlane.m_name.GetData(), "")) { + if (m_skateboardPlane.IsPresent()) { isle->m_skateboard->PlaceActor(m_skateboardPlane); } else { @@ -1637,7 +1637,7 @@ void Act1State::PlaceActors() } if (m_helicopter != NULL) { - if (!strcmp(m_helicopterPlane.m_name.GetData(), "")) { + if (!m_helicopterPlane.IsPresent()) { m_helicopter->SpawnPlayer(LegoGameState::e_unk40, FALSE, 0); } else { @@ -1654,7 +1654,7 @@ void Act1State::PlaceActors() GetViewManager()->Add(m_helicopter->GetROI()); m_helicopter->GetROI()->SetVisibility(TRUE); - m_helicopterPlane.m_name = ""; + m_helicopterPlane.Reset(); m_helicopter = NULL; if (m_helicopterWindshield != NULL) { @@ -1677,7 +1677,7 @@ void Act1State::PlaceActors() } if (m_jetski != NULL) { - if (!strcmp(m_jetskiPlane.m_name.GetData(), "")) { + if (!m_jetskiPlane.IsPresent()) { m_jetski->SpawnPlayer(LegoGameState::e_unk45, FALSE, 0); } else { @@ -1690,7 +1690,7 @@ void Act1State::PlaceActors() GetViewManager()->Add(m_jetski->GetROI()); m_jetski->GetROI()->SetVisibility(TRUE); - m_jetskiPlane.m_name = ""; + m_jetskiPlane.Reset(); m_jetski = NULL; if (m_jetskiFront != NULL) { @@ -1707,7 +1707,7 @@ void Act1State::PlaceActors() } if (m_dunebuggy != NULL) { - if (!strcmp(m_dunebuggyPlane.m_name.GetData(), "")) { + if (!m_dunebuggyPlane.IsPresent()) { m_dunebuggy->SpawnPlayer(LegoGameState::e_unk43, FALSE, 0); } else { @@ -1724,7 +1724,7 @@ void Act1State::PlaceActors() GetViewManager()->Add(m_dunebuggy->GetROI()); m_dunebuggy->GetROI()->SetVisibility(TRUE); - m_dunebuggyPlane.m_name = ""; + m_dunebuggyPlane.Reset(); m_dunebuggy = NULL; if (m_dunebuggyFront != NULL) { @@ -1735,7 +1735,7 @@ void Act1State::PlaceActors() } if (m_racecar != NULL) { - if (!strcmp(m_racecarPlane.m_name.GetData(), "")) { + if (!m_racecarPlane.IsPresent()) { m_racecar->SpawnPlayer(LegoGameState::e_unk44, FALSE, 0); } else { @@ -1752,7 +1752,7 @@ void Act1State::PlaceActors() GetViewManager()->Add(m_racecar->GetROI()); m_racecar->GetROI()->SetVisibility(TRUE); - m_racecarPlane.m_name = ""; + m_racecarPlane.Reset(); m_racecar = NULL; if (m_racecarFront != NULL) { diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index ccbaa0c3..5ade0b3a 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -339,7 +339,7 @@ void RegistrationBook::FUN_100778c0() if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); - if (strcmp(act1state->m_helicopterPlane.m_name.GetData(), "")) { + if (act1state->m_helicopterPlane.IsPresent()) { InvokeAction(Extra::e_start, m_atomId, CopterScript::c_Helicopter_Actor, NULL); NotificationManager()->Send( this, @@ -349,7 +349,7 @@ void RegistrationBook::FUN_100778c0() m_unk0x2b8++; } - if (strcmp(act1state->m_jetskiPlane.m_name.GetData(), "")) { + if (act1state->m_jetskiPlane.IsPresent()) { InvokeAction(Extra::e_start, m_atomId, JetskiScript::c_Jetski_Actor, NULL); NotificationManager()->Send( this, @@ -359,7 +359,7 @@ void RegistrationBook::FUN_100778c0() m_unk0x2b8++; } - if (strcmp(act1state->m_dunebuggyPlane.m_name.GetData(), "")) { + if (act1state->m_dunebuggyPlane.IsPresent()) { InvokeAction(Extra::e_start, m_atomId, DunecarScript::c_DuneBugy_Actor, NULL); NotificationManager()->Send( this, @@ -369,7 +369,7 @@ void RegistrationBook::FUN_100778c0() m_unk0x2b8++; } - if (strcmp(act1state->m_racecarPlane.m_name.GetData(), "")) { + if (act1state->m_racecarPlane.IsPresent()) { InvokeAction(Extra::e_start, m_atomId, RacecarScript::c_RaceCar_Actor, NULL); NotificationManager()->Send( this,