Revert some stuff

This commit is contained in:
Christian Semmler 2025-01-16 18:12:28 -07:00
parent f9babc4f63
commit ff35af9828
5 changed files with 24 additions and 20 deletions

View File

@ -27,6 +27,10 @@ struct LegoNamedPlane {
void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; } void SetDirection(const Mx3DPointFloat& p_direction) { m_direction = p_direction; }
void SetUp(const Mx3DPointFloat& p_up) { m_up = p_up; } 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 // FUNCTION: LEGO1 0x100344d0
MxResult Serialize(LegoStorage* p_storage) MxResult Serialize(LegoStorage* p_storage)
{ {

View File

@ -1165,7 +1165,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
} }
gameState->m_helicopter = (Helicopter*) entity; gameState->m_helicopter = (Helicopter*) entity;
gameState->m_helicopterPlane.m_name = ""; gameState->m_helicopterPlane.Reset();
break; break;
case LegoGameState::e_dunecarbuild: case LegoGameState::e_dunecarbuild:
if (gameState->m_dunebuggy) { if (gameState->m_dunebuggy) {
@ -1173,7 +1173,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
} }
gameState->m_dunebuggy = (DuneBuggy*) entity; gameState->m_dunebuggy = (DuneBuggy*) entity;
gameState->m_dunebuggyPlane.m_name = ""; gameState->m_dunebuggyPlane.Reset();
break; break;
case LegoGameState::e_jetskibuild: case LegoGameState::e_jetskibuild:
if (gameState->m_jetski) { if (gameState->m_jetski) {
@ -1181,7 +1181,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
} }
gameState->m_jetski = (Jetski*) entity; gameState->m_jetski = (Jetski*) entity;
gameState->m_jetskiPlane.m_name = ""; gameState->m_jetskiPlane.Reset();
break; break;
case LegoGameState::e_racecarbuild: case LegoGameState::e_racecarbuild:
if (gameState->m_racecar) { if (gameState->m_racecar) {
@ -1189,7 +1189,7 @@ undefined4 LegoCarBuild::FUN_10024c20(LegoEventNotificationParam* p_param)
} }
gameState->m_racecar = (RaceCar*) entity; gameState->m_racecar = (RaceCar*) entity;
gameState->m_racecarPlane.m_name = ""; gameState->m_racecarPlane.Reset();
break; break;
} }

View File

@ -752,7 +752,7 @@ void LegoPathActor::UpdatePlane(LegoNamedPlane& p_namedPlane)
// FUNCTION: LEGO1 0x1002f830 // FUNCTION: LEGO1 0x1002f830
void LegoPathActor::PlaceActor(LegoNamedPlane& p_namedPlane) void LegoPathActor::PlaceActor(LegoNamedPlane& p_namedPlane)
{ {
if (strcmp(p_namedPlane.m_name.GetData(), "")) { if (p_namedPlane.IsPresent()) {
LegoWorld* world = CurrentWorld(); LegoWorld* world = CurrentWorld();
world->PlaceActor(this, p_namedPlane.GetName(), 0, 0.5f, 1, 0.5f); world->PlaceActor(this, p_namedPlane.GetName(), 0, 0.5f, 1, 0.5f);
SetLocation(p_namedPlane.GetPosition(), p_namedPlane.GetDirection(), p_namedPlane.GetUp(), TRUE); SetLocation(p_namedPlane.GetPosition(), p_namedPlane.GetDirection(), p_namedPlane.GetUp(), TRUE);

View File

@ -1615,21 +1615,21 @@ void Act1State::PlaceActors()
{ {
Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); 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); isle->m_motocycle->PlaceActor(m_motocyclePlane);
} }
else { else {
isle->PlaceActor(isle->m_motocycle, "INT43", 4, 0.5f, 1, 0.5f); 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); isle->m_bike->PlaceActor(m_bikePlane);
} }
else { else {
isle->PlaceActor(isle->m_bike, "INT44", 2, 0.5f, 0, 0.5f); 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); isle->m_skateboard->PlaceActor(m_skateboardPlane);
} }
else { else {
@ -1637,7 +1637,7 @@ void Act1State::PlaceActors()
} }
if (m_helicopter != NULL) { if (m_helicopter != NULL) {
if (!strcmp(m_helicopterPlane.m_name.GetData(), "")) { if (!m_helicopterPlane.IsPresent()) {
m_helicopter->SpawnPlayer(LegoGameState::e_unk40, FALSE, 0); m_helicopter->SpawnPlayer(LegoGameState::e_unk40, FALSE, 0);
} }
else { else {
@ -1654,7 +1654,7 @@ void Act1State::PlaceActors()
GetViewManager()->Add(m_helicopter->GetROI()); GetViewManager()->Add(m_helicopter->GetROI());
m_helicopter->GetROI()->SetVisibility(TRUE); m_helicopter->GetROI()->SetVisibility(TRUE);
m_helicopterPlane.m_name = ""; m_helicopterPlane.Reset();
m_helicopter = NULL; m_helicopter = NULL;
if (m_helicopterWindshield != NULL) { if (m_helicopterWindshield != NULL) {
@ -1677,7 +1677,7 @@ void Act1State::PlaceActors()
} }
if (m_jetski != NULL) { if (m_jetski != NULL) {
if (!strcmp(m_jetskiPlane.m_name.GetData(), "")) { if (!m_jetskiPlane.IsPresent()) {
m_jetski->SpawnPlayer(LegoGameState::e_unk45, FALSE, 0); m_jetski->SpawnPlayer(LegoGameState::e_unk45, FALSE, 0);
} }
else { else {
@ -1690,7 +1690,7 @@ void Act1State::PlaceActors()
GetViewManager()->Add(m_jetski->GetROI()); GetViewManager()->Add(m_jetski->GetROI());
m_jetski->GetROI()->SetVisibility(TRUE); m_jetski->GetROI()->SetVisibility(TRUE);
m_jetskiPlane.m_name = ""; m_jetskiPlane.Reset();
m_jetski = NULL; m_jetski = NULL;
if (m_jetskiFront != NULL) { if (m_jetskiFront != NULL) {
@ -1707,7 +1707,7 @@ void Act1State::PlaceActors()
} }
if (m_dunebuggy != NULL) { if (m_dunebuggy != NULL) {
if (!strcmp(m_dunebuggyPlane.m_name.GetData(), "")) { if (!m_dunebuggyPlane.IsPresent()) {
m_dunebuggy->SpawnPlayer(LegoGameState::e_unk43, FALSE, 0); m_dunebuggy->SpawnPlayer(LegoGameState::e_unk43, FALSE, 0);
} }
else { else {
@ -1724,7 +1724,7 @@ void Act1State::PlaceActors()
GetViewManager()->Add(m_dunebuggy->GetROI()); GetViewManager()->Add(m_dunebuggy->GetROI());
m_dunebuggy->GetROI()->SetVisibility(TRUE); m_dunebuggy->GetROI()->SetVisibility(TRUE);
m_dunebuggyPlane.m_name = ""; m_dunebuggyPlane.Reset();
m_dunebuggy = NULL; m_dunebuggy = NULL;
if (m_dunebuggyFront != NULL) { if (m_dunebuggyFront != NULL) {
@ -1735,7 +1735,7 @@ void Act1State::PlaceActors()
} }
if (m_racecar != NULL) { if (m_racecar != NULL) {
if (!strcmp(m_racecarPlane.m_name.GetData(), "")) { if (!m_racecarPlane.IsPresent()) {
m_racecar->SpawnPlayer(LegoGameState::e_unk44, FALSE, 0); m_racecar->SpawnPlayer(LegoGameState::e_unk44, FALSE, 0);
} }
else { else {
@ -1752,7 +1752,7 @@ void Act1State::PlaceActors()
GetViewManager()->Add(m_racecar->GetROI()); GetViewManager()->Add(m_racecar->GetROI());
m_racecar->GetROI()->SetVisibility(TRUE); m_racecar->GetROI()->SetVisibility(TRUE);
m_racecarPlane.m_name = ""; m_racecarPlane.Reset();
m_racecar = NULL; m_racecar = NULL;
if (m_racecarFront != NULL) { if (m_racecarFront != NULL) {

View File

@ -339,7 +339,7 @@ void RegistrationBook::FUN_100778c0()
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); 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); InvokeAction(Extra::e_start, m_atomId, CopterScript::c_Helicopter_Actor, NULL);
NotificationManager()->Send( NotificationManager()->Send(
this, this,
@ -349,7 +349,7 @@ void RegistrationBook::FUN_100778c0()
m_unk0x2b8++; 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); InvokeAction(Extra::e_start, m_atomId, JetskiScript::c_Jetski_Actor, NULL);
NotificationManager()->Send( NotificationManager()->Send(
this, this,
@ -359,7 +359,7 @@ void RegistrationBook::FUN_100778c0()
m_unk0x2b8++; 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); InvokeAction(Extra::e_start, m_atomId, DunecarScript::c_DuneBugy_Actor, NULL);
NotificationManager()->Send( NotificationManager()->Send(
this, this,
@ -369,7 +369,7 @@ void RegistrationBook::FUN_100778c0()
m_unk0x2b8++; 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); InvokeAction(Extra::e_start, m_atomId, RacecarScript::c_RaceCar_Actor, NULL);
NotificationManager()->Send( NotificationManager()->Send(
this, this,