Remove IsPresent

This commit is contained in:
Christian Semmler 2025-01-16 17:54:50 -07:00
parent 8108eac88c
commit f9babc4f63
4 changed files with 10 additions and 8 deletions

View File

@ -13,6 +13,10 @@ struct LegoNamedPlane {
// FUNCTION: LEGO1 0x10033a70
// LegoNamedPlane::~LegoNamedPlane
// Unclear whether getters/setters were used.
// Act1State::Serialize seems to access `m_name` directly (only matches like that)
// Act1State::PlaceActors though seems to require extensive use of getters to improve
const char* GetName() const { return m_name.GetData(); }
const Mx3DPointFloat& GetPosition() { return m_position; }
const Mx3DPointFloat& GetDirection() { return m_direction; }
@ -23,9 +27,6 @@ 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; }
// FUNCTION: LEGO1 0x100344d0
MxResult Serialize(LegoStorage* p_storage)
{

View File

@ -752,7 +752,7 @@ void LegoPathActor::UpdatePlane(LegoNamedPlane& p_namedPlane)
// FUNCTION: LEGO1 0x1002f830
void LegoPathActor::PlaceActor(LegoNamedPlane& p_namedPlane)
{
if (p_namedPlane.IsPresent()) {
if (strcmp(p_namedPlane.m_name.GetData(), "")) {
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);

View File

@ -339,7 +339,7 @@ void RegistrationBook::FUN_100778c0()
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (act1state->m_helicopterPlane.IsPresent()) {
if (strcmp(act1state->m_helicopterPlane.m_name.GetData(), "")) {
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 (act1state->m_jetskiPlane.IsPresent()) {
if (strcmp(act1state->m_jetskiPlane.m_name.GetData(), "")) {
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 (act1state->m_dunebuggyPlane.IsPresent()) {
if (strcmp(act1state->m_dunebuggyPlane.m_name.GetData(), "")) {
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 (act1state->m_racecarPlane.IsPresent()) {
if (strcmp(act1state->m_racecarPlane.m_name.GetData(), "")) {
InvokeAction(Extra::e_start, m_atomId, RacecarScript::c_RaceCar_Actor, NULL);
NotificationManager()->Send(
this,

View File

@ -42,6 +42,7 @@ class ViewManager {
// FUNCTION: BETA10 0x100576b0
const CompoundObject& GetROIs() { return rois; }
// FUNCTION: BETA10 0x100e1260
void Add(ViewROI* p_roi) { rois.push_back(p_roi); }
// SYNTHETIC: LEGO1 0x100a6000