diff options
Diffstat (limited to '')
-rw-r--r-- | src/control/CarAI.cpp | 8 | ||||
-rw-r--r-- | src/control/CarCtrl.cpp | 4 | ||||
-rw-r--r-- | src/control/GameLogic.cpp | 2 | ||||
-rw-r--r-- | src/control/Garages.cpp | 2 | ||||
-rw-r--r-- | src/control/Phones.cpp | 18 | ||||
-rw-r--r-- | src/control/Phones.h | 7 | ||||
-rw-r--r-- | src/control/SceneEdit.cpp | 8 | ||||
-rw-r--r-- | src/control/Script.cpp | 28 |
8 files changed, 28 insertions, 49 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp index a5002ec5..7e517a83 100644 --- a/src/control/CarAI.cpp +++ b/src/control/CarAI.cpp @@ -585,7 +585,7 @@ void CCarAI::AddFiretruckOccupants(CVehicle* pVehicle) void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) { if (pVehicle->pDriver){ - pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); if (pVehicle->GetModelIndex() == MI_AMBULAN) pVehicle->pDriver->Say(SOUND_PED_LEAVE_VEHICLE); } @@ -593,7 +593,7 @@ void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++){ if (pVehicle->pPassengers[i]) { pVehicle->pPassengers[i]->m_leaveCarTimer = timer; - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); timer += CGeneral::GetRandomNumberInRange(200, 400); } } @@ -602,7 +602,7 @@ void CCarAI::TellOccupantsToLeaveCar(CVehicle* pVehicle) void CCarAI::TellOccupantsToFleeCar(CVehicle* pVehicle) { if (pVehicle->pDriver && !pVehicle->pDriver->IsPlayer()) { - pVehicle->pDriver->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + pVehicle->pDriver->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); if (pVehicle->GetModelIndex() != MI_FIRETRUCK && pVehicle->GetModelIndex() == MI_AMBULAN) pVehicle->pDriver->Say(SOUND_PED_LEAVE_VEHICLE); } @@ -610,7 +610,7 @@ void CCarAI::TellOccupantsToFleeCar(CVehicle* pVehicle) for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++) { if (pVehicle->pPassengers[i]) { pVehicle->pPassengers[i]->m_leaveCarTimer = timer; - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_FLEE_TILL_SAFE); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE); timer += CGeneral::GetRandomNumberInRange(200, 400); } } diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 3b19a5b0..514150a6 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -701,7 +701,7 @@ CCarCtrl::GenerateOneRandomCar() pVehicle->SetMoveSpeed(0.0f, 0.0f, 0.0f); for (int i = 0; i < pVehicle->m_nNumPassengers; i++) { if (pVehicle->pPassengers[i]) { - pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); pVehicle->pPassengers[i]->m_nLastPedState = PED_WANDER_PATH; pVehicle->pPassengers[i]->m_vehicleInAccident = pVehicle; pVehicle->pPassengers[i]->bDeadPedInFrontOfCar = true; @@ -709,7 +709,7 @@ CCarCtrl::GenerateOneRandomCar() } } if (pVehicle->pDriver) { - pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pVehicle->pDriver->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); pVehicle->pDriver->m_nLastPedState = PED_WANDER_PATH; pVehicle->pDriver->m_vehicleInAccident = pVehicle; pVehicle->pDriver->bDeadPedInFrontOfCar = true; diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp index 50e5584d..61b8a0e0 100644 --- a/src/control/GameLogic.cpp +++ b/src/control/GameLogic.cpp @@ -503,7 +503,7 @@ CGameLogic::UpdateShortCut() case SHORTCUT_ARRIVING: if (CTimer::GetTimeInMilliseconds() > ShortCutTimer) { CWorld::Players[CWorld::PlayerInFocus].m_nMoney = Max(0, CWorld::Players[CWorld::PlayerInFocus].m_nMoney - SHORTCUT_TAXI_COST); - FindPlayerPed()->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pShortCutTaxi); + FindPlayerPed()->SetObjective(OBJECTIVE_LEAVE_CAR, pShortCutTaxi); FindPlayerPed()->m_carInObjective = pShortCutTaxi; ShortCutState = SHORTCUT_GETTING_OUT; } diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index f0b924e6..88654141 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1100,7 +1100,7 @@ bool CGarage::IsStaticPlayerCarEntirelyInside() return false; if (FindPlayerPed()->GetPedState() != PED_DRIVING) return false; - if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_VEHICLE) + if (FindPlayerPed()->m_objective == OBJECTIVE_LEAVE_CAR) return false; CVehicle* pVehicle = FindPlayerVehicle(); if (pVehicle->GetPosition().x < m_fInfX || pVehicle->GetPosition().x > m_fSupX || diff --git a/src/control/Phones.cpp b/src/control/Phones.cpp index 6fac3f9d..c0b50119 100644 --- a/src/control/Phones.cpp +++ b/src/control/Phones.cpp @@ -34,18 +34,6 @@ CPed *CPhoneInfo::pCallBackPed; // ped who picking up the phone (reset after pic after 60 seconds of last phone pick-up. */ -#ifdef TOGGLEABLE_BETA_FEATURES -CPed* crimeReporters[NUMPHONES] = {}; -bool -isPhoneAvailable(int m_phoneId) -{ - return gPhoneInfo.m_aPhones[m_phoneId].m_nState == PHONE_STATE_FREE && - (crimeReporters[m_phoneId] == nil || !crimeReporters[m_phoneId]->IsPointerValid() || !crimeReporters[m_phoneId]->bRunningToPhone || crimeReporters[m_phoneId]->m_objective > OBJECTIVE_IDLE || - crimeReporters[m_phoneId]->m_nLastPedState != PED_SEEK_POS && - (crimeReporters[m_phoneId]->m_nPedState != PED_MAKE_CALL && crimeReporters[m_phoneId]->m_nPedState != PED_FACE_PHONE && crimeReporters[m_phoneId]->m_nPedState != PED_SEEK_POS)); -} -#endif - void CPhoneInfo::Update(void) { @@ -164,11 +152,7 @@ CPhoneInfo::FindNearestFreePhone(CVector *pos) for (int phoneId = 0; phoneId < m_nMax; phoneId++) { - if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE -#ifdef TOGGLEABLE_BETA_FEATURES - && isPhoneAvailable(phoneId) -#endif - ) { + if (gPhoneInfo.m_aPhones[phoneId].m_nState == PHONE_STATE_FREE) { float phoneDist = (m_aPhones[phoneId].m_vecPos - *pos).Magnitude2D(); if (phoneDist < nearestPhoneDist) { diff --git a/src/control/Phones.h b/src/control/Phones.h index 14d47ed1..81b40dc2 100644 --- a/src/control/Phones.h +++ b/src/control/Phones.h @@ -66,9 +66,4 @@ public: extern CPhoneInfo gPhoneInfo; void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg); -void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg); - -#ifdef TOGGLEABLE_BETA_FEATURES -extern CPed *crimeReporters[NUMPHONES]; -bool isPhoneAvailable(int); -#endif
\ No newline at end of file +void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg);
\ No newline at end of file diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp index 535f6bec..a7727fde 100644 --- a/src/control/SceneEdit.cpp +++ b/src/control/SceneEdit.cpp @@ -631,7 +631,7 @@ void CSceneEdit::ProcessCommand(void) SelectActor(); if (m_bActorSelected) { if (pActors[m_nActor]->bInVehicle) { - pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR); Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_GET_OUT_CAR; Movie[m_nNumMovieCommands++].m_nActorId = m_nActor; } @@ -695,7 +695,7 @@ void CSceneEdit::ProcessCommand(void) case MOVIE_WAIT: SelectActor(); if (m_bActorSelected) { - pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT); Movie[m_nNumMovieCommands].m_nCommandId = MOVIE_WAIT; Movie[m_nNumMovieCommands++].m_nActorId = m_nActor; } @@ -876,7 +876,7 @@ void CSceneEdit::PlayBack(void) case MOVIE_GET_OUT_CAR: m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId; if (pActors[m_nActor]->bInVehicle) - pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_VEHICLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_LEAVE_CAR); else ++m_nCurrentMovieCommand; break; @@ -895,7 +895,7 @@ void CSceneEdit::PlayBack(void) break; case MOVIE_WAIT: m_nActor = Movie[m_nCurrentMovieCommand].m_nActorId; - pActors[m_nActor]->SetObjective(OBJECTIVE_IDLE); + pActors[m_nActor]->SetObjective(OBJECTIVE_WAIT_ON_FOOT); ++m_nCurrentMovieCommand; break; case MOVIE_POSITION_CAMERA: diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 8635a548..74dfaac6 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1530,7 +1530,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command) CPed* pTestedPed = ped->m_nearPeds[i]; if (!pTestedPed || !IsPedPointerValid(pTestedPed)) continue; - if (pTestedPed->m_pedInObjective == ped && pTestedPed->m_objective == OBJECTIVE_FOLLOW_PED_IN_FORMATION) { + if (pTestedPed->m_pedInObjective == ped && pTestedPed->m_objective == OBJECTIVE_FOLLOW_CHAR_IN_FORMATION) { CVector vFollowerPos = pTestedPed->GetFormationPosition(); CTheScripts::ClearSpaceForMissionEntity(vFollowerPos, ped); bool bFound = false; @@ -2070,7 +2070,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) CPed* ped = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(ped); ped->bScriptObjectiveCompleted = false; - ped->SetObjective(OBJECTIVE_IDLE); + ped->SetObjective(OBJECTIVE_WAIT_ON_FOOT); return 0; } case COMMAND_GET_CHAR_COORDINATES: @@ -3840,7 +3840,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_IDLE); + pPed->SetObjective(OBJECTIVE_WAIT_ON_FOOT); return 0; } case COMMAND_SET_CHAR_OBJ_FLEE_ON_FOOT_TILL_SAFE: @@ -4321,7 +4321,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pVehicle); return 0; } case COMMAND_SET_CHAR_OBJ_ENTER_CAR_AS_PASSENGER: @@ -4353,7 +4353,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_DESTROY_OBJ, pVehicle); + pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pVehicle); return 0; } case COMMAND_SET_CHAR_OBJ_DESTROY_CAR: @@ -6568,7 +6568,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) assert(pPed); CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_FOLLOW_PED_IN_FORMATION, pTargetPed); + pPed->SetObjective(OBJECTIVE_FOLLOW_CHAR_IN_FORMATION, pTargetPed); pPed->SetFormation((eFormation)ScriptParams[2]); return 0; } @@ -8804,7 +8804,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pPed->m_pMyVehicle); return 0; } case COMMAND_SET_SPRITES_DRAW_BEFORE_FADE: @@ -9537,7 +9537,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE && pPed->m_pMyVehicle == pVehicle); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR && pPed->m_pMyVehicle == pVehicle); return 0; } case COMMAND_IS_PLAYER_SITTING_IN_ANY_CAR: @@ -9545,7 +9545,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 1); CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pPed); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR); return 0; } /* @@ -9582,7 +9582,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) assert(pPed); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); assert(pVehicle); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE && pPed->m_pMyVehicle == pVehicle); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR && pPed->m_pMyVehicle == pVehicle); return 0; } case COMMAND_IS_CHAR_SITTING_IN_ANY_CAR: @@ -9590,7 +9590,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CollectParameters(&m_nIp, 1); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); - UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_VEHICLE); + UpdateCompareFlag(pPed->GetPedState() == PED_DRIVING && pPed->m_objective != OBJECTIVE_LEAVE_CAR); return 0; } case COMMAND_IS_PLAYER_ON_FOOT: @@ -10718,7 +10718,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CPed* pTargetPed = CPools::GetPedPool()->GetAt(ScriptParams[1]); assert(pTargetPed); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_AIM_GUN_AT_PED, pTargetPed); + pPed->SetObjective(OBJECTIVE_AIM_GUN_AT, pTargetPed); return 0; } case COMMAND_SWITCH_SECURITY_CAMERA: @@ -11134,7 +11134,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) pos.y = *(float*)&ScriptParams[2]; pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_SPRINT_TO_COORD, pos); + pPed->SetObjective(OBJECTIVE_SPRINT_TO_AREA, pos); return 0; } case COMMAND_CREATE_SWAT_ROPE: @@ -14239,7 +14239,7 @@ void CTheScripts::CleanUpThisPed(CPed* pPed) } else { if (pPed->m_pMyVehicle->m_vehType == VEHICLE_TYPE_CAR) { - pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, pPed->m_pMyVehicle); + pPed->SetObjective(OBJECTIVE_LEAVE_CAR, pPed->m_pMyVehicle); pPed->bWanderPathAfterExitingCar = true; } } |