diff --git a/LEGO1/lego/legoomni/include/legomain.h b/LEGO1/lego/legoomni/include/legomain.h index 98245c5c..95cf7324 100644 --- a/LEGO1/lego/legoomni/include/legomain.h +++ b/LEGO1/lego/legoomni/include/legomain.h @@ -127,7 +127,7 @@ class LegoOmni : public MxOmni { ViewLODListManager* GetViewLODListManager() { return m_viewLODListManager; } LegoWorld* GetCurrentWorld() { return m_currentWorld; } LegoNavController* GetNavController() { return m_navController; } - LegoPathActor* GetCurrentActor() { return m_currentActor; } + LegoPathActor* GetUserActor() { return m_userActor; } LegoPlantManager* GetPlantManager() { return m_plantManager; } LegoAnimationManager* GetAnimationManager() { return m_animationManager; } LegoBuildingManager* GetBuildingManager() { return m_buildingManager; } @@ -139,7 +139,7 @@ class LegoOmni : public MxOmni { LegoWorldList* GetWorldList() { return m_worldList; } inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; } - inline void SetCurrentActor(LegoPathActor* p_currentActor) { m_currentActor = p_currentActor; } + inline void SetUserActor(LegoPathActor* p_userActor) { m_userActor = p_userActor; } inline void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; } inline void SetExit(MxBool p_exit) { m_exit = p_exit; } inline MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) @@ -162,7 +162,7 @@ class LegoOmni : public MxOmni { LegoWorld* m_currentWorld; // 0x7c MxBool m_exit; // 0x80 LegoNavController* m_navController; // 0x84 - LegoPathActor* m_currentActor; // 0x88 + LegoPathActor* m_userActor; // 0x88 LegoCharacterManager* m_characterManager; // 0x8c LegoPlantManager* m_plantManager; // 0x90 LegoAnimationManager* m_animationManager; // 0x94 diff --git a/LEGO1/lego/legoomni/include/misc.h b/LEGO1/lego/legoomni/include/misc.h index 34824772..9f476ae9 100644 --- a/LEGO1/lego/legoomni/include/misc.h +++ b/LEGO1/lego/legoomni/include/misc.h @@ -40,7 +40,7 @@ LegoControlManager* ControlManager(); LegoGameState* GameState(); LegoAnimationManager* AnimationManager(); LegoNavController* NavController(); -LegoPathActor* CurrentActor(); +LegoPathActor* UserActor(); LegoWorld* CurrentWorld(); LegoCharacterManager* CharacterManager(); ViewManager* GetViewManager(); @@ -51,7 +51,7 @@ ViewLODListManager* GetViewLODListManager(); void FUN_10015820(MxBool p_disable, MxU16 p_flags); LegoROI* FindROI(const char* p_name); void SetROIVisible(const char* p_name, MxBool p_visible); -void SetCurrentActor(LegoPathActor* p_currentActor); +void SetUserActor(LegoPathActor* p_userActor); MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction); void DeleteAction(); LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); diff --git a/LEGO1/lego/legoomni/src/actors/ambulance.cpp b/LEGO1/lego/legoomni/src/actors/ambulance.cpp index 95b7dd73..6dbb2842 100644 --- a/LEGO1/lego/legoomni/src/actors/ambulance.cpp +++ b/LEGO1/lego/legoomni/src/actors/ambulance.cpp @@ -149,7 +149,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param) } else if (objectId == IsleScript::c_hho027en_RunAnim) { m_state->m_unk0x08 = 1; - CurrentWorld()->PlaceActor(CurrentActor()); + CurrentWorld()->PlaceActor(UserActor()); HandleClick(); m_unk0x172 = 0; TickleManager()->RegisterClient(this, 40000); @@ -173,7 +173,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param) } } else if (objectId == IsleScript::c_hpz055pa_RunAnim || objectId == IsleScript::c_hpz057ma_RunAnim) { - CurrentWorld()->PlaceActor(CurrentActor()); + CurrentWorld()->PlaceActor(UserActor()); HandleClick(); SpawnPlayer(LegoGameState::e_pizzeriaExterior, TRUE, 0); m_unk0x172 = 0; @@ -197,7 +197,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param) } } else if (objectId == IsleScript::c_hps117bd_RunAnim) { - CurrentWorld()->PlaceActor(CurrentActor()); + CurrentWorld()->PlaceActor(UserActor()); HandleClick(); SpawnPlayer(LegoGameState::e_unk33, TRUE, 0); m_unk0x172 = 0; @@ -245,12 +245,12 @@ MxLong Ambulance::HandleClick() ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } m_time = Timer()->GetTime(); - m_unk0x16a = CurrentActor()->GetActorId(); + m_unk0x16a = UserActor()->GetActorId(); Enter(); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL); @@ -294,10 +294,58 @@ void Ambulance::FUN_10037060() // TODO } -// STUB: LEGO1 0x10037160 +// FUNCTION: LEGO1 0x10037160 +// FUNCTION: BETA10 0x100237df MxResult Ambulance::Tickle() { - // TODO + if (m_unk0x172 == 0) { + m_unk0x172 = 1; + } + else if (m_lastAction == IsleScript::c_noneIsle) { + IsleScript::Script objectId; + + switch ((rand() % 12) + 1) { + case 1: + objectId = IsleScript::c_ham034ra_PlayWav; + break; + case 2: + objectId = IsleScript::c_ham035ra_PlayWav; + break; + case 3: + objectId = IsleScript::c_ham036ra_PlayWav; + break; + case 4: + objectId = IsleScript::c_hpz037ma_PlayWav; + break; + case 5: + objectId = IsleScript::c_sns078pa_PlayWav; + break; + case 6: + objectId = IsleScript::c_ham039ra_PlayWav; + break; + case 7: + objectId = IsleScript::c_ham040cl_PlayWav; + break; + case 8: + objectId = IsleScript::c_ham041cl_PlayWav; + break; + case 9: + objectId = IsleScript::c_ham042cl_PlayWav; + break; + case 10: + objectId = IsleScript::c_ham043cl_PlayWav; + break; + case 11: + objectId = IsleScript::c_ham044cl_PlayWav; + break; + case 12: + objectId = IsleScript::c_ham045cl_PlayWav; + break; + } + + PlayAction(objectId); + } + return SUCCESS; } diff --git a/LEGO1/lego/legoomni/src/actors/buildings.cpp b/LEGO1/lego/legoomni/src/actors/buildings.cpp index 2d896957..45cc73e1 100644 --- a/LEGO1/lego/legoomni/src/actors/buildings.cpp +++ b/LEGO1/lego/legoomni/src/actors/buildings.cpp @@ -28,8 +28,8 @@ MxLong InfoCenterEntity::VTable0x50(MxParam& p_param) { switch (GameState()->GetCurrentAct()) { case LegoGameState::Act::e_act1: { - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); @@ -70,8 +70,8 @@ MxLong GasStationEntity::VTable0x50(MxParam& p_param) if (state->GetUnknown18() != 8) { state->SetUnknown18(0); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); @@ -94,8 +94,8 @@ MxLong HospitalEntity::VTable0x50(MxParam& p_param) if (act1State->GetUnknown18() != 10) { act1State->SetUnknown18(0); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); @@ -118,8 +118,8 @@ MxLong PoliceEntity::VTable0x50(MxParam& p_param) if (state->GetUnknown18() != 10) { state->SetUnknown18(0); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); @@ -140,8 +140,8 @@ MxLong BeachHouseEntity::VTable0x50(MxParam& p_param) Act1State* state = (Act1State*) GameState()->GetState("Act1State"); state->SetUnknown18(0); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); @@ -161,8 +161,8 @@ MxLong RaceStandsEntity::VTable0x50(MxParam& p_param) Act1State* state = (Act1State*) GameState()->GetState("Act1State"); state->SetUnknown18(0); - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 5bd4b364..4b69588a 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -77,8 +77,8 @@ void Helicopter::Exit() if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { GameState()->SetCurrentArea(LegoGameState::e_copter); - if (CurrentActor() && CurrentActor()->IsA("IslePathActor")) { - ((IslePathActor*) CurrentActor()) + if (UserActor() && UserActor()->IsA("IslePathActor")) { + ((IslePathActor*) UserActor()) ->SpawnPlayer( LegoGameState::e_unk55, TRUE, @@ -115,9 +115,9 @@ MxLong Helicopter::HandleClick() AnimationManager()->FUN_1005f6d0(FALSE); - if (CurrentActor()) { - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()) { + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } } diff --git a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp index a0539fe5..bcd863cb 100644 --- a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp @@ -75,9 +75,9 @@ MxLong IslePathActor::Notify(MxParam& p_param) void IslePathActor::Enter() { m_roi->SetVisibility(FALSE); - if (CurrentActor() != this) { + if (UserActor() != this) { m_previousVel = NavController()->GetMaxLinearVel(); - m_previousActor = CurrentActor(); + m_previousActor = UserActor(); if (m_previousActor) { m_previousActor->ResetWorldTransform(FALSE); m_previousActor->SetUserNavFlag(FALSE); @@ -91,7 +91,7 @@ void IslePathActor::Enter() NavController()->ResetMaxLinearVel(m_maxLinearVel); - SetCurrentActor(this); + SetUserActor(this); FUN_1001b660(); FUN_10010c30(); } @@ -110,7 +110,7 @@ void IslePathActor::Exit() SetUserNavFlag(FALSE); if (m_previousActor != NULL) { - SetCurrentActor(m_previousActor); + SetUserActor(m_previousActor); NavController()->ResetMaxLinearVel(m_previousVel); m_previousActor->ResetWorldTransform(TRUE); m_previousActor->SetUserNavFlag(TRUE); diff --git a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp index 1aefb3d5..e327a6c6 100644 --- a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp +++ b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp @@ -37,8 +37,8 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param) return 1; } - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); } ((Isle*) FindWorld(*g_isleScript, 0))->SetDestLocation(LegoGameState::e_jukeboxw); diff --git a/LEGO1/lego/legoomni/src/actors/pizzeria.cpp b/LEGO1/lego/legoomni/src/actors/pizzeria.cpp index b1c563e3..a0cabb73 100644 --- a/LEGO1/lego/legoomni/src/actors/pizzeria.cpp +++ b/LEGO1/lego/legoomni/src/actors/pizzeria.cpp @@ -49,9 +49,9 @@ void Pizzeria::CreateState() undefined4 Pizzeria::HandleClick() { if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) { - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - if (!CurrentActor()->IsA("SkateBoard")) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + if (!UserActor()->IsA("SkateBoard")) { + ((IslePathActor*) UserActor())->Exit(); } } diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 8e88733a..2c2e6c85 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -84,13 +84,13 @@ MxLong SkateBoard::HandleClick() ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_skateboard); TransitionManager()->StartTransition(MxTransitionManager::TransitionType::e_mosaic, 50, FALSE, TRUE); - if (GameState()->GetActorId() != CurrentActor()->GetActorId()) { - if (!CurrentActor()->IsA("SkateBoard")) { - ((IslePathActor*) CurrentActor())->Exit(); + if (GameState()->GetActorId() != UserActor()->GetActorId()) { + if (!UserActor()->IsA("SkateBoard")) { + ((IslePathActor*) UserActor())->Exit(); } } - if (!CurrentActor()->IsA("SkateBoard")) { + if (!UserActor()->IsA("SkateBoard")) { Enter(); InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_SkateDashboard, NULL); GetCurrentAction().SetObjectId(-1); @@ -154,7 +154,7 @@ void SkateBoard::ActivateSceneActions() if (!m_act1state->m_unk0x022) { m_act1state->m_unk0x022 = TRUE; - MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World()); + MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5); AnimationManager() diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 50e1581c..c49ddb73 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -998,7 +998,7 @@ MxResult LegoAnimationManager::FUN_100605e0( FUN_100648f0(tranInfo, m_unk0x404); } else if (p_unk0x0a) { - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor != NULL) { actor->SetState(4); @@ -1435,7 +1435,7 @@ MxResult LegoAnimationManager::Tickle() return SUCCESS; } - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); LegoROI* roi; if (actor == NULL || (roi = actor->GetROI()) == NULL) { @@ -1658,7 +1658,7 @@ MxBool LegoAnimationManager::FUN_100623a0(AnimInfo& p_info) LegoEntityListCursor cursor(entityList); LegoEntity* entity; - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); while (cursor.Next(entity)) { if (entity != actor && entity->IsA("LegoPathActor")) { @@ -1861,7 +1861,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und) if (world != NULL) { PurgeExtra(FALSE); - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor == NULL || actor->GetWorldSpeed() <= 20.0f) { MxU32 i; for (i = 0; i < m_numAllowedExtras && m_extras[i].m_roi != NULL; i++) { @@ -2478,7 +2478,7 @@ MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, Mx { MxU32 local2c = 12; float destScale = ((rand() * 0.5) / 32767.0) + 0.25; - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor == NULL) { return FALSE; @@ -2760,7 +2760,7 @@ void LegoAnimationManager::FUN_100648f0(LegoTranInfo* p_tranInfo, MxLong p_unk0x m_unk0x43c = viewROI->GetLocal2World(); p_tranInfo->m_unk0x2c = m_unk0x43c; - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor != NULL) { actor->SetState(4); actor->SetWorldSpeed(0.0f); diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index d115e732..62ba85a2 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -426,7 +426,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time) MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time) { LegoROI* viewROI = VideoManager()->GetViewROI(); - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_location != -1 && actor != NULL) { if (m_unk0x64 != NULL) { diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 5e1fcdeb..6ac670d7 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -171,8 +171,8 @@ void LegoGameState::SetActor(MxU8 p_actorId) m_actorId = p_actorId; } - LegoPathActor* oldActor = CurrentActor(); - SetCurrentActor(NULL); + LegoPathActor* oldActor = UserActor(); + SetUserActor(NULL); IslePathActor* newActor = new IslePathActor(); const char* actorName = LegoActor::GetActorName(m_actorId); @@ -192,14 +192,14 @@ void LegoGameState::SetActor(MxU8 p_actorId) } newActor->ClearFlag(0x02); - SetCurrentActor(newActor); + SetUserActor(newActor); } // FUNCTION: LEGO1 0x10039910 void LegoGameState::RemoveActor() { - LegoPathActor* actor = CurrentActor(); - SetCurrentActor(NULL); + LegoPathActor* actor = UserActor(); + SetUserActor(NULL); delete actor; m_actorId = 0; } @@ -208,7 +208,7 @@ void LegoGameState::RemoveActor() void LegoGameState::ResetROI() { if (m_actorId) { - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor) { LegoROI* roi = actor->GetROI(); @@ -887,7 +887,7 @@ void LegoGameState::SwitchArea(Area p_area) case e_garadoor: LoadIsle(); VariableTable()->SetVariable("VISIBILITY", "Hide Gas"); - CurrentActor()->ResetWorldTransform(FALSE); + UserActor()->ResetWorldTransform(FALSE); NavController()->UpdateLocation(59); // LCAMZG1 in g_cameraLocations VideoManager()->Get3DManager()->SetFrustrum(90, 0.1f, 250.0f); InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_GaraDoor, NULL); @@ -901,11 +901,11 @@ void LegoGameState::SwitchArea(Area p_area) } else { SetCameraControllerFromIsle(); - CurrentActor()->ResetWorldTransform(TRUE); + UserActor()->ResetWorldTransform(TRUE); AnimationManager()->Resume(); } - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( p_area, TRUE, @@ -920,9 +920,9 @@ void LegoGameState::SwitchArea(Area p_area) case e_unk33: LoadIsle(); SetCameraControllerFromIsle(); - CurrentActor()->ResetWorldTransform(TRUE); + UserActor()->ResetWorldTransform(TRUE); AnimationManager()->Resume(); - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( p_area, TRUE, diff --git a/LEGO1/lego/legoomni/src/common/legoutils.cpp b/LEGO1/lego/legoomni/src/common/legoutils.cpp index a0c1095b..7efa5a96 100644 --- a/LEGO1/lego/legoomni/src/common/legoutils.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutils.cpp @@ -467,8 +467,8 @@ MxBool FUN_1003ef60() GameState()->m_currentArea != LegoGameState::e_elevdown && GameState()->m_currentArea != LegoGameState::e_garadoor && GameState()->m_currentArea != LegoGameState::e_polidoor) { - if (CurrentActor() == NULL || !CurrentActor()->IsA("TowTrack")) { - if (CurrentActor() == NULL || !CurrentActor()->IsA("Ambulance")) { + if (UserActor() == NULL || !UserActor()->IsA("TowTrack")) { + if (UserActor() == NULL || !UserActor()->IsA("Ambulance")) { MxU32 unk0x18 = act1State->GetUnknown18(); if (unk0x18 != 10 && unk0x18 != 8 && unk0x18 != 3) { diff --git a/LEGO1/lego/legoomni/src/common/misc.cpp b/LEGO1/lego/legoomni/src/common/misc.cpp index 2427097c..29cc4cd6 100644 --- a/LEGO1/lego/legoomni/src/common/misc.cpp +++ b/LEGO1/lego/legoomni/src/common/misc.cpp @@ -67,9 +67,9 @@ LegoNavController* NavController() } // FUNCTION: LEGO1 0x10015790 -LegoPathActor* CurrentActor() +LegoPathActor* UserActor() { - return LegoOmni::GetInstance()->GetCurrentActor(); + return LegoOmni::GetInstance()->GetUserActor(); } // FUNCTION: LEGO1 0x100157a0 @@ -137,9 +137,9 @@ void SetROIVisible(const char* p_name, MxBool p_visible) } // FUNCTION: LEGO1 0x10015880 -void SetCurrentActor(LegoPathActor* p_currentActor) +void SetUserActor(LegoPathActor* p_userActor) { - LegoOmni::GetInstance()->SetCurrentActor(p_currentActor); + LegoOmni::GetInstance()->SetUserActor(p_userActor); } // FUNCTION: LEGO1 0x10015890 diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index d19a854a..74236576 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -705,7 +705,7 @@ void LegoWorld::Enable(MxBool p_enable) else if (!p_enable && m_set0xd0.empty()) { MxPresenter* presenter; LegoPathController* controller; - LegoPathActor* actor = CurrentActor(); + LegoPathActor* actor = UserActor(); if (actor) { RemoveActor(actor); diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index e6c2cdc1..1cdf1561 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -65,7 +65,7 @@ void LegoOmni::Init() m_worldList = NULL; m_currentWorld = NULL; m_exit = FALSE; - m_currentActor = NULL; + m_userActor = NULL; m_characterManager = NULL; m_plantManager = NULL; m_gameState = NULL; diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index b2250703..c374ab5e 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -554,7 +554,7 @@ void LegoPathActor::ParseAction(char* p_extra) if (KeyValueStringParse(value, g_strPERMIT_NAVIGATE, p_extra)) { SetUserNavFlag(TRUE); NavController()->ResetMaxLinearVel(m_worldSpeed); - SetCurrentActor(this); + SetUserActor(this); } char* token; diff --git a/LEGO1/lego/legoomni/src/race/legorace.cpp b/LEGO1/lego/legoomni/src/race/legorace.cpp index 7430f922..ce0bb8d3 100644 --- a/LEGO1/lego/legoomni/src/race/legorace.cpp +++ b/LEGO1/lego/legoomni/src/race/legorace.cpp @@ -61,9 +61,9 @@ MxResult LegoRace::Create(MxDSAction& p_dsAction) if (result == SUCCESS) { m_act1State = (Act1State*) GameState()->GetState("Act1State"); ControlManager()->Register(this); - m_pathActor = CurrentActor(); + m_pathActor = UserActor(); m_pathActor->SetWorldSpeed(0); - SetCurrentActor(NULL); + SetUserActor(NULL); } return result; @@ -74,7 +74,7 @@ LegoRace::~LegoRace() { g_unk0x100f119c = FALSE; if (m_pathActor) { - SetCurrentActor(m_pathActor); + SetUserActor(m_pathActor); NavController()->ResetMaxLinearVel(m_pathActor->GetMaxLinearVel()); m_pathActor = NULL; } @@ -118,7 +118,7 @@ MxLong LegoRace::Notify(MxParam& p_param) void LegoRace::Enable(MxBool p_enable) { if (GetUnknown0xd0Empty() != p_enable && !p_enable) { - Remove(CurrentActor()); + Remove(UserActor()); MxU8 oldActorId = GameState()->GetActorId(); GameState()->RemoveActor(); diff --git a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp index 10debbd7..f5383ee9 100644 --- a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp +++ b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp @@ -131,7 +131,7 @@ void GasStation::ReadyWorld() PlayMusic(JukeboxScript::c_JBMusic2); m_trackLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "TrackLed_Bitmap"); - m_currentActorId = CurrentActor()->GetActorId(); + m_currentActorId = UserActor()->GetActorId(); switch (m_currentActorId) { case LegoActor::c_pepper: diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index 8cd8ae92..e08a39c6 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -144,11 +144,11 @@ void Hospital::ReadyWorld() m_copLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "CopLed_Bitmap"); m_pizzaLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "PizzaLed_Bitmap"); - if (CurrentActor() == NULL) { + if (UserActor() == NULL) { m_currentActorId = LegoActor::c_laura; } else { - m_currentActorId = CurrentActor()->GetActorId(); + m_currentActorId = UserActor()->GetActorId(); } switch (m_currentActorId) { diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index b96d5814..55b5006b 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -82,8 +82,8 @@ Isle::~Isle() InputManager()->ClearWorld(); } - if (CurrentActor() != NULL) { - VTable0x6c(CurrentActor()); + if (UserActor() != NULL) { + VTable0x6c(UserActor()); } NotificationManager()->Unregister(this); @@ -157,7 +157,7 @@ MxLong Isle::Notify(MxParam& p_param) case c_notificationEndAnim: switch (m_act1state->m_unk0x018) { case 4: - result = CurrentActor()->Notify(p_param); + result = UserActor()->Notify(p_param); break; case 8: result = m_towtrack->Notify(p_param); @@ -473,11 +473,11 @@ MxLong Isle::HandleType19Notification(MxType19NotificationParam& p_param) { MxLong result = 0; - if (CurrentActor() != NULL) { - if (CurrentActor() == m_dunebuggy) { + if (UserActor() != NULL) { + if (UserActor() == m_dunebuggy) { result = m_dunebuggy->Notify(p_param); } - else if (CurrentActor() == m_motocycle) { + else if (UserActor() == m_motocycle) { result = m_motocycle->Notify(p_param); } } @@ -544,9 +544,9 @@ void Isle::Enable(MxBool p_enable) VideoManager()->ResetPalette(FALSE); m_act1state->FUN_10034d00(); - if (CurrentActor() != NULL && CurrentActor()->GetActorId() != LegoActor::c_none) { + if (UserActor() != NULL && UserActor()->GetActorId() != LegoActor::c_none) { // TODO: Match, most likely an inline function - MxS32 targetEntityId = (CurrentActor()->GetActorId() == 1) + 250; + MxS32 targetEntityId = (UserActor()->GetActorId() == 1) + 250; if (targetEntityId != -1) { InvokeAction(Extra::e_start, *g_isleScript, targetEntityId, NULL); @@ -575,8 +575,8 @@ void Isle::Enable(MxBool p_enable) } } - if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) { - IslePathActor* actor = (IslePathActor*) CurrentActor(); + if (UserActor() != NULL && UserActor()->IsA("Jetski")) { + IslePathActor* actor = (IslePathActor*) UserActor(); actor->SpawnPlayer( LegoGameState::e_unk45, FALSE, @@ -599,7 +599,7 @@ void Isle::Enable(MxBool p_enable) m_act1state->m_unk0x018 = 5; } - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -622,7 +622,7 @@ void Isle::Enable(MxBool p_enable) SetIsWorldActive(FALSE); break; case LegoGameState::e_bike: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -635,7 +635,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_dunecar: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -648,7 +648,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_motocycle: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -661,7 +661,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_copter: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -674,7 +674,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_skateboard: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -687,7 +687,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_jetski: - PlaceActor(CurrentActor()); + PlaceActor(UserActor()); SetIsWorldActive(TRUE); #ifdef COMPAT_MODE @@ -714,7 +714,7 @@ void Isle::Enable(MxBool p_enable) AnimationManager()->FUN_10064740(NULL); } else if (GameState()->m_currentArea == LegoGameState::e_unk66) { - Mx3DPointFloat position(CurrentActor()->GetROI()->GetWorldPosition()); + Mx3DPointFloat position(UserActor()->GetROI()->GetWorldPosition()); Mx3DPointFloat sub(-21.375f, 0.0f, -41.75f); ((Vector3&) sub).Sub(position); @@ -730,7 +730,7 @@ void Isle::Enable(MxBool p_enable) } break; case 5: { - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( LegoGameState::e_jetrace2, FALSE, @@ -763,7 +763,7 @@ void Isle::Enable(MxBool p_enable) } case 6: { GameState()->m_currentArea = LegoGameState::e_carraceExterior; - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( LegoGameState::e_unk21, FALSE, @@ -813,7 +813,7 @@ void Isle::Enable(MxBool p_enable) break; case 11: m_act1state->m_unk0x018 = 0; - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( LegoGameState::e_jukeboxExterior, TRUE, @@ -863,9 +863,9 @@ void Isle::FUN_10032620() switch (GameState()->m_currentArea) { case LegoGameState::e_unk66: { - MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World()); - LegoPathBoundary* boundary = CurrentActor()->GetBoundary(); - ((IslePathActor*) CurrentActor())->VTable0xec(mat, boundary, TRUE); + MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); + LegoPathBoundary* boundary = UserActor()->GetBoundary(); + ((IslePathActor*) UserActor())->VTable0xec(mat, boundary, TRUE); break; } case LegoGameState::e_unk4: @@ -878,7 +878,7 @@ void Isle::FUN_10032620() case LegoGameState::e_hospitalExterior: case LegoGameState::e_unk31: case LegoGameState::e_policeExterior: - ((IslePathActor*) CurrentActor()) + ((IslePathActor*) UserActor()) ->SpawnPlayer( GameState()->m_currentArea, TRUE, @@ -1188,19 +1188,19 @@ MxBool Isle::Escape() switch (m_act1state->m_unk0x018) { case 3: - if (CurrentActor() != NULL) { + if (UserActor() != NULL) { m_pizza->FUN_10038380(); m_pizza->FUN_100382b0(); } break; case 8: - if (CurrentActor() != NULL && !CurrentActor()->IsA("TowTrack")) { + if (UserActor() != NULL && !UserActor()->IsA("TowTrack")) { m_towtrack->FUN_1004db10(); m_towtrack->FUN_1004dbe0(); } break; case 10: - if (CurrentActor() != NULL && !CurrentActor()->IsA("Ambulance")) { + if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) { m_ambulance->StopActions(); m_ambulance->FUN_10037250(); } @@ -1217,9 +1217,9 @@ MxBool Isle::Escape() AnimationManager()->FUN_10061010(FALSE); DeleteObjects(&m_atom, IsleScript::c_sba001bu_RunAnim, IsleScript::c_FNS018EN_Wav_518); - if (CurrentActor()) { - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()) { + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); m_skateboard->SetUnknown0x160(FALSE); } } @@ -1241,21 +1241,21 @@ MxBool Isle::Escape() void Isle::FUN_10033350() { if (m_act1state->m_unk0x018 == 10) { - if (CurrentActor() != NULL && !CurrentActor()->IsA("Ambulance")) { + if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) { m_ambulance->StopActions(); m_ambulance->FUN_10037250(); } } if (m_act1state->m_unk0x018 == 8) { - if (CurrentActor() != NULL && !CurrentActor()->IsA("TowTrack")) { + if (UserActor() != NULL && !UserActor()->IsA("TowTrack")) { m_towtrack->FUN_1004db10(); m_towtrack->FUN_1004dbe0(); } } if (m_act1state->m_unk0x018 == 3) { - if (CurrentActor() != NULL) { + if (UserActor() != NULL) { m_pizza->FUN_10038380(); m_pizza->FUN_100382b0(); } @@ -1263,9 +1263,9 @@ void Isle::FUN_10033350() AnimationManager()->FUN_10061010(FALSE); - if (CurrentActor()) { - if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - ((IslePathActor*) CurrentActor())->Exit(); + if (UserActor()) { + if (UserActor()->GetActorId() != GameState()->GetActorId()) { + ((IslePathActor*) UserActor())->Exit(); m_skateboard->SetUnknown0x160(FALSE); } } diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index e09eb88d..9fde7a10 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -26,8 +26,8 @@ LegoAct2::~LegoAct2() FUN_10051900(); InputManager()->UnRegister(this); - if (CurrentActor()) { - Remove(CurrentActor()); + if (UserActor()) { + Remove(UserActor()); } NotificationManager()->Unregister(this); diff --git a/LEGO1/lego/legoomni/src/worlds/police.cpp b/LEGO1/lego/legoomni/src/worlds/police.cpp index 0efbea20..66422959 100644 --- a/LEGO1/lego/legoomni/src/worlds/police.cpp +++ b/LEGO1/lego/legoomni/src/worlds/police.cpp @@ -230,7 +230,7 @@ void PoliceState::FUN_1005ea40() return; } - switch (CurrentActor()->GetActorId()) { + switch (UserActor()->GetActorId()) { case LegoActor::c_nick: policeScript = PoliceScript::c_nps002la_RunAnim; m_policeScript = policeScript;