summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarAI.cpp16
-rw-r--r--src/control/CarCtrl.cpp26
-rw-r--r--src/control/GameLogic.cpp12
-rw-r--r--src/control/Garages.cpp8
-rw-r--r--src/control/Record.cpp6
-rw-r--r--src/control/Remote.cpp4
-rw-r--r--src/control/Replay.cpp4
-rw-r--r--src/control/RoadBlocks.cpp2
-rw-r--r--src/control/SceneEdit.cpp8
-rw-r--r--src/control/Script.cpp40
-rw-r--r--src/control/TrafficLights.cpp2
11 files changed, 64 insertions, 64 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index a8e77fc2..f0df1ed2 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -41,7 +41,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE)
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
}
- switch (pVehicle->m_status){
+ switch (pVehicle->GetStatus()){
case STATUS_PLAYER:
case STATUS_PLAYER_PLAYBACKFROMBUFFER:
case STATUS_TRAIN_MOVING:
@@ -330,12 +330,12 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (ABS(FindPlayerCoors().x - pVehicle->GetPosition().x) > 10.0f ||
ABS(FindPlayerCoors().y - pVehicle->GetPosition().y) > 10.0f){
pVehicle->AutoPilot.m_nCruiseSpeed = FindPoliceCarSpeedForWantedLevel(pVehicle);
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->AutoPilot.m_nCarMission = FindPoliceCarMissionForWantedLevel();
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
}else if (pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE){
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
TellOccupantsToLeaveCar(pVehicle);
pVehicle->AutoPilot.m_nCruiseSpeed = 0;
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
@@ -357,7 +357,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nTimeToStartMission = CTimer::GetTimeInMilliseconds();
pVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
}
- if (pVehicle->m_status == STATUS_PHYSICS && pVehicle->AutoPilot.m_nTempAction == TEMPACT_NONE){
+ if (pVehicle->GetStatus() == STATUS_PHYSICS && pVehicle->AutoPilot.m_nTempAction == TEMPACT_NONE){
if (pVehicle->AutoPilot.m_nCarMission != MISSION_NONE){
if (pVehicle->AutoPilot.m_nCarMission != MISSION_STOP_FOREVER &&
pVehicle->AutoPilot.m_nCruiseSpeed != 0 &&
@@ -386,7 +386,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
CTimer::GetPreviousTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeToStartMission <= 30000 &&
pVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE &&
!CTrafficLights::ShouldCarStopForBridge(pVehicle)){
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
CCarCtrl::SwitchVehicleToRealPhysics(pVehicle);
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
pVehicle->AutoPilot.m_nTempAction = TEMPACT_REVERSE;
@@ -446,7 +446,7 @@ float CCarAI::GetCarToGoToCoors(CVehicle* pVehicle, CVector* pTarget)
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
pVehicle->AutoPilot.m_nCruiseSpeed = 20;
pVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->AutoPilot.m_nCarMission = (CCarCtrl::JoinCarWithRoadSystemGotoCoors(pVehicle, *pTarget, false)) ?
MISSION_GOTOCOORDS_STRAIGHT : MISSION_GOTOCOORDS;
}else if (Abs(pTarget->x - pVehicle->AutoPilot.m_vecDestinationCoors.x) > 2.0f ||
@@ -603,7 +603,7 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle)
continue;
if (vehicle->m_vehType != VEHICLE_TYPE_CAR && vehicle->m_vehType != VEHICLE_TYPE_BIKE)
continue;
- if (vehicle->m_status != STATUS_SIMPLE && vehicle->m_status != STATUS_PHYSICS)
+ if (vehicle->GetStatus() != STATUS_SIMPLE && vehicle->GetStatus() != STATUS_PHYSICS)
continue;
if (vehicle->VehicleCreatedBy != RANDOM_VEHICLE)
continue;
@@ -627,7 +627,7 @@ void CCarAI::MakeWayForCarWithSiren(CVehicle *pVehicle)
TEMPACT_SWERVELEFT : TEMPACT_SWERVERIGHT;
vehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 2000;
}
- vehicle->m_status = STATUS_PHYSICS;
+ vehicle->SetStatus(STATUS_PHYSICS);
}else{
if (DotProduct2D(vehicle->GetMoveSpeed(), distance) < 0.0f && vehicle->AutoPilot.m_nTempAction != TEMPACT_WAIT){
vehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index f347b2c9..bb70be8c 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -482,10 +482,10 @@ CCarCtrl::GenerateOneRandomCar()
case NINES:
case GANG8:
case GANG9:
- pCar->m_status = STATUS_SIMPLE;
+ pCar->SetStatus(STATUS_SIMPLE);
break;
case COPS:
- pCar->m_status = (pCar->AutoPilot.m_nCarMission == MISSION_CRUISE) ? STATUS_SIMPLE : STATUS_PHYSICS;
+ pCar->SetStatus((pCar->AutoPilot.m_nCarMission == MISSION_CRUISE) ? STATUS_SIMPLE : STATUS_PHYSICS);
pCar->ChangeLawEnforcerState(1);
break;
default:
@@ -532,7 +532,7 @@ CCarCtrl::GenerateOneRandomCar()
else
pCar->SetUpDriver();
if ((CGeneral::GetRandomNumber() & 0x3F) == 0){ /* 1/64 probability */
- pCar->m_status = STATUS_PHYSICS;
+ pCar->SetStatus(STATUS_PHYSICS);
pCar->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
pCar->AutoPilot.m_nCruiseSpeed += 10;
}
@@ -702,7 +702,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
return;
}
}
- if ((pVehicle->m_status == STATUS_SIMPLE || pVehicle->m_status == STATUS_PHYSICS && pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_STOP_FOR_CARS) &&
+ if ((pVehicle->GetStatus() == STATUS_SIMPLE || pVehicle->GetStatus() == STATUS_PHYSICS && pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_STOP_FOR_CARS) &&
CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeToStartMission > 5000 &&
!pVehicle->GetIsOnScreen() &&
(pVehicle->GetPosition() - vecPlayerPos).Magnitude2D() > 25.0f &&
@@ -716,7 +716,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
delete pVehicle;
return;
}
- if (pVehicle->m_status != STATUS_WRECKED || pVehicle->m_nTimeOfDeath == 0)
+ if (pVehicle->GetStatus() != STATUS_WRECKED || pVehicle->m_nTimeOfDeath == 0)
return;
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
(!pVehicle->GetIsOnScreen() || !CRenderer::IsEntityCullZoneVisible(pVehicle))){
@@ -759,7 +759,7 @@ CCarCtrl::UpdateCarOnRails(CVehicle* pVehicle)
SlowCarOnRailsDownForTrafficAndLights(pVehicle);
if (pVehicle->AutoPilot.m_nTimeEnteredCurve + pVehicle->AutoPilot.m_nTimeToSpendOnCurrentCurve <= CTimer::GetTimeInMilliseconds())
PickNextNodeAccordingStrategy(pVehicle);
- if (pVehicle->m_status == STATUS_PHYSICS)
+ if (pVehicle->GetStatus() == STATUS_PHYSICS)
return;
CCarPathLink* pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];
CCarPathLink* pNextLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nNextPathNodeInfo];
@@ -917,7 +917,7 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f
if (sideLength + 0.5f < sidewaysDistance)
/* If car is far enough taking side into account, don't care */
continue;
- if (pPed->m_type == ENTITY_TYPE_PED){ /* ...how can it not be? */
+ if (pPed->IsPed()){ /* ...how can it not be? */
if (pPed->GetPedState() != PED_STEP_AWAY && pPed->GetPedState() != PED_DIVE_AWAY){
if (distanceUntilHit < movementTowardsPedPerSecond){
/* Very close. Time to evade. */
@@ -937,7 +937,7 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f
}
}else{
/* Relatively safe but annoying. */
- if (pVehicle->m_status == STATUS_PLAYER &&
+ if (pVehicle->GetStatus() == STATUS_PLAYER &&
pPed->GetPedState() != PED_FLEE_ENTITY &&
pPed->CharCreatedBy == RANDOM_CHAR){
float angleCarToPed = CGeneral::GetRadianAngleBetweenPoints(
@@ -1042,8 +1042,8 @@ void CCarCtrl::SlowCarDownForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle,
DotProduct2D(pVehicle->GetForward(), pOtherVehicle->GetForward()) < 0.5f &&
pVehicle < pOtherVehicle){ /* that comparasion though... */
*pSpeed = Max(curSpeed / 5, *pSpeed);
- if (pVehicle->m_status == STATUS_SIMPLE){
- pVehicle->m_status = STATUS_PHYSICS;
+ if (pVehicle->GetStatus() == STATUS_SIMPLE){
+ pVehicle->SetStatus(STATUS_PHYSICS);
SwitchVehicleToRealPhysics(pVehicle);
}
pVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
@@ -1535,7 +1535,7 @@ void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
pNextLink = &ThePaths.m_carPathLinks[ThePaths.m_carPathConnections[nextLink + pCurPathNode->firstLink]];
if (prevNode == pVehicle->AutoPilot.m_nNextRouteNode){
/* We can no longer shift vehicle without physics if we have to turn it around. */
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
SwitchVehicleToRealPhysics(pVehicle);
}
pVehicle->AutoPilot.m_nTimeEnteredCurve += pVehicle->AutoPilot.m_nTimeToSpendOnCurrentCurve;
@@ -1640,7 +1640,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
float distanceToTargetNode;
#ifndef REMOVE_TREADABLE_PATHFIND
if (pTarget && pTarget->m_pCurGroundEntity &&
- pTarget->m_pCurGroundEntity->m_type == ENTITY_TYPE_BUILDING &&
+ pTarget->m_pCurGroundEntity->IsBuilding() &&
((CBuilding*)pTarget->m_pCurGroundEntity)->GetIsATreadable() &&
((CTreadable*)pTarget->m_pCurGroundEntity)->m_nodeIndices[0][0] >= 0){
CTreadable* pCurrentMapObject = (CTreadable*)pTarget->m_pCurGroundEntity;
@@ -2674,7 +2674,7 @@ bool CCarCtrl::GenerateOneEmergencyServicesCar(uint32 mi, CVector vecPos)
spawnPos.z = groundZ + pVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
pVehicle->GetPosition() = spawnPos;
pVehicle->SetMoveSpeed(CVector(0.0f, 0.0f, 0.0f));
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
switch (mi){
case MI_FIRETRUCK:
pVehicle->bIsFireTruckOnDuty = true;
diff --git a/src/control/GameLogic.cpp b/src/control/GameLogic.cpp
index f8c8fa69..abb5c5f3 100644
--- a/src/control/GameLogic.cpp
+++ b/src/control/GameLogic.cpp
@@ -102,8 +102,8 @@ CGameLogic::Update()
if (pVehicle != nil) {
if (pVehicle->pDriver == pPlayerInfo.m_pPed) {
pVehicle->pDriver = nil;
- if (pVehicle->m_status != STATUS_WRECKED)
- pVehicle->m_status = STATUS_ABANDONED;
+ if (pVehicle->GetStatus() != STATUS_WRECKED)
+ pVehicle->SetStatus(STATUS_ABANDONED);
} else
pVehicle->RemovePassenger(pPlayerInfo.m_pPed);
}
@@ -172,8 +172,8 @@ CGameLogic::Update()
if (pVehicle != nil) {
if (pVehicle->pDriver == pPlayerInfo.m_pPed) {
pVehicle->pDriver = nil;
- if (pVehicle->m_status != STATUS_WRECKED)
- pVehicle->m_status = STATUS_ABANDONED;
+ if (pVehicle->GetStatus() != STATUS_WRECKED)
+ pVehicle->SetStatus(STATUS_ABANDONED);
}
else
pVehicle->RemovePassenger(pPlayerInfo.m_pPed);
@@ -214,8 +214,8 @@ CGameLogic::Update()
if (pVehicle != nil) {
if (pVehicle->pDriver == pPlayerInfo.m_pPed) {
pVehicle->pDriver = nil;
- if (pVehicle->m_status != STATUS_WRECKED)
- pVehicle->m_status = STATUS_ABANDONED;
+ if (pVehicle->GetStatus() != STATUS_WRECKED)
+ pVehicle->SetStatus(STATUS_ABANDONED);
} else
pVehicle->RemovePassenger(pPlayerInfo.m_pPed);
}
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 0367e9bc..fd18f4cf 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -749,7 +749,7 @@ void CGarage::Update()
if (((CAutomobile*)(m_pTarget))->Damage.GetEngineStatus() <= ENGINE_STATUS_ON_FIRE &&
((CAutomobile*)(m_pTarget))->m_fFireBlowUpTimer == 0.0f) {
#endif
- if (m_pTarget->m_status != STATUS_WRECKED) {
+ if (m_pTarget->GetStatus() != STATUS_WRECKED) {
CPad::GetPad(0)->SetDisablePlayerControls(PLAYERCONTROL_GARAGE);
FindPlayerPed()->m_pWanted->m_bIgnoredByCops = true;
m_eGarageState = GS_CLOSING;
@@ -1855,7 +1855,7 @@ CVehicle* CStoredCar::RestoreCar()
CVehicle* pVehicle = new CAutomobile(m_nModelIndex, RANDOM_VEHICLE);
#endif
pVehicle->GetPosition() = m_vecPos;
- pVehicle->m_status = STATUS_ABANDONED;
+ pVehicle->SetStatus(STATUS_ABANDONED);
pVehicle->GetForward() = m_vecAngle;
pVehicle->GetRight() = CVector(m_vecAngle.y, -m_vecAngle.x, 0.0f);
pVehicle->GetUp() = CVector(0.0f, 0.0f, 1.0f);
@@ -1975,7 +1975,7 @@ void CGarage::TidyUpGarage()
if (pVehicle->GetPosition().x > m_fX1 && pVehicle->GetPosition().x < m_fX2 &&
pVehicle->GetPosition().y > m_fY1 && pVehicle->GetPosition().y < m_fY2 &&
pVehicle->GetPosition().z > m_fZ1 && pVehicle->GetPosition().z < m_fZ2) {
- if (pVehicle->m_status == STATUS_WRECKED || pVehicle->GetUp().z < 0.5f) {
+ if (pVehicle->GetStatus() == STATUS_WRECKED || pVehicle->GetUp().z < 0.5f) {
CWorld::Remove(pVehicle);
delete pVehicle;
}
@@ -1990,7 +1990,7 @@ void CGarage::TidyUpGarageClose()
CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i);
if (!pVehicle || !pVehicle->IsCar())
continue;
- if (!pVehicle->IsCar() || pVehicle->m_status != STATUS_WRECKED || !IsEntityTouching3D(pVehicle))
+ if (!pVehicle->IsCar() || pVehicle->GetStatus() != STATUS_WRECKED || !IsEntityTouching3D(pVehicle))
continue;
bool bRemove = false;
if (m_eGarageState != GS_FULLYCLOSED) {
diff --git a/src/control/Record.cpp b/src/control/Record.cpp
index b9e8f8da..bba9a45d 100644
--- a/src/control/Record.cpp
+++ b/src/control/Record.cpp
@@ -286,7 +286,7 @@ void CRecordDataForChase::SaveOrRetrieveCarPositions(void)
}
if (Status == STATE_PLAYBACK_BEFORE_RECORDING) {
Status = STATE_RECORD;
- pChaseCars[CurrentCar]->m_status = STATUS_PLAYER;
+ pChaseCars[CurrentCar]->SetStatus(STATUS_PLAYER);
}
}
break;
@@ -408,7 +408,7 @@ void CRecordDataForChase::GiveUsACar(int32 mi, CVector pos, float angle, CAutomo
return;
CAutomobile* pCar = new CAutomobile(mi, MISSION_VEHICLE);
pCar->GetPosition() = pos;
- pCar->m_status = STATUS_PLAYER_PLAYBACKFROMBUFFER;
+ pCar->SetStatus(STATUS_PLAYER_PLAYBACKFROMBUFFER);
pCar->GetMatrix().SetRotateZOnly(DEGTORAD(angle));
pCar->pDriver = nil;
pCar->m_currentColour1 = colour1;
@@ -517,7 +517,7 @@ CVehicle* CRecordDataForChase::TurnChaseCarIntoScriptCar(int32 i)
{
CVehicle* pVehicle = pChaseCars[i];
pChaseCars[i] = nil;
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
return pVehicle;
}
diff --git a/src/control/Remote.cpp b/src/control/Remote.cpp
index 9c749bd9..ee729d7e 100644
--- a/src/control/Remote.cpp
+++ b/src/control/Remote.cpp
@@ -19,7 +19,7 @@ CRemote::GivePlayerRemoteControlledCar(float x, float y, float z, float rot, uin
car->GetMatrix().SetRotateZOnly(rot);
car->GetPosition() = CVector(x, y, z);
- car->m_status = STATUS_PLAYER_REMOTE;
+ car->SetStatus(STATUS_PLAYER_REMOTE);
car->bIsLocked = true;
CCarCtrl::JoinCarWithRoadSystem(car);
@@ -31,7 +31,7 @@ CRemote::GivePlayerRemoteControlledCar(float x, float y, float z, float rot, uin
car->bEngineOn = true;
CWorld::Add(car);
if (FindPlayerVehicle() != nil)
- FindPlayerVehicle()->m_status = STATUS_PLAYER_DISABLED;
+ FindPlayerVehicle()->SetStatus(STATUS_PLAYER_DISABLED);
CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = car;
CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->RegisterReference((CEntity**)&CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle);
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index da350660..f9e894b6 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -850,7 +850,7 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
else{
new_v = new(vp->index << 8) CAutomobile(mi, 2);
}
- new_v->m_status = STATUS_PLAYER_PLAYBACKFROMBUFFER;
+ new_v->SetStatus(STATUS_PLAYER_PLAYBACKFROMBUFFER);
vp->matrix.DecompressIntoFullMatrix(new_v->GetMatrix());
new_v->m_currentColour1 = vp->primary_color;
new_v->m_currentColour2 = vp->secondary_color;
@@ -870,7 +870,7 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
}
else {
CPed* new_p = new(ph->index << 8) CCivilianPed((ePedType)ph->pedtype, ph->mi);
- new_p->m_status = STATUS_PLAYER_PLAYBACKFROMBUFFER;
+ new_p->SetStatus(STATUS_PLAYER_PLAYBACKFROMBUFFER);
new_p->GetMatrix().SetUnity();
CWorld::Add(new_p);
}
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index 7fb0c211..65625d8c 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -156,7 +156,7 @@ CRoadBlocks::GenerateRoadBlocks(void)
CWorld::FindObjectsKindaColliding(vehicleMatrix.GetPosition(), fModelRadius, 0, &colliding, 2, nil, false, true, true, false, false);
if (!colliding) {
CAutomobile *pVehicle = new CAutomobile(vehicleId, RANDOM_VEHICLE);
- pVehicle->m_status = STATUS_ABANDONED;
+ pVehicle->SetStatus(STATUS_ABANDONED);
// pVehicle->GetHeightAboveRoad(); // called but return value is ignored?
vehicleMatrix.GetPosition().z += fModelRadius - 0.6f;
pVehicle->m_matrix = vehicleMatrix;
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index 7f914a76..8e9fc754 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -450,7 +450,7 @@ void CSceneEdit::ProcessCommand(void)
break;
}
CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE);
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->GetPosition() = m_vecCurrentPosition;
pVehicle->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(pVehicle);
@@ -567,7 +567,7 @@ void CSceneEdit::ProcessCommand(void)
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_STRAIGHT;
else
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
- pActors[m_nActor]->m_pMyVehicle->m_status = STATUS_PHYSICS;
+ pActors[m_nActor]->m_pMyVehicle->SetStatus(STATUS_PHYSICS);
pActors[m_nActor]->m_pMyVehicle->bEngineOn = true;
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = Max(16, pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCruiseSpeed);
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
@@ -810,7 +810,7 @@ void CSceneEdit::PlayBack(void)
break;
}
CVehicle* pVehicle = new CAutomobile(m_nVehiclemodelId, MISSION_VEHICLE);
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->GetPosition() = m_vecCurrentPosition;
pVehicle->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(pVehicle);
@@ -845,7 +845,7 @@ void CSceneEdit::PlayBack(void)
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_STRAIGHT;
else
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
- pActors[m_nActor]->m_pMyVehicle->m_status = STATUS_PHYSICS;
+ pActors[m_nActor]->m_pMyVehicle->SetStatus(STATUS_PHYSICS);
pActors[m_nActor]->m_pMyVehicle->bEngineOn = true;
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = Max(16, pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nCruiseSpeed);
pActors[m_nActor]->m_pMyVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 1f65ce6e..4b3ed3bd 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1737,7 +1737,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
if (ped->InVehicle()) {
if (ped->m_pMyVehicle->pDriver == ped) {
ped->m_pMyVehicle->RemoveDriver();
- ped->m_pMyVehicle->m_status = STATUS_ABANDONED;
+ ped->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
if (ped->m_pMyVehicle->m_nDoorLock == CARLOCK_LOCKED_INITIALLY)
ped->m_pMyVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
if (ped->m_nPedType == PEDTYPE_COP && ped->m_pMyVehicle->IsLawEnforcementVehicle())
@@ -1933,7 +1933,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
pos.z += boat->GetDistanceFromCentreOfMassToBaseOfModel();
boat->GetPosition() = pos;
CTheScripts::ClearSpaceForMissionEntity(pos, boat);
- boat->m_status = STATUS_ABANDONED;
+ boat->SetStatus(STATUS_ABANDONED);
boat->bIsLocked = true;
boat->AutoPilot.m_nCarMission = MISSION_NONE;
boat->AutoPilot.m_nTempAction = TEMPACT_NONE; /* Animation ID? */
@@ -1951,7 +1951,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
car->GetPosition() = pos;
CTheScripts::ClearSpaceForMissionEntity(pos, car);
- car->m_status = STATUS_ABANDONED;
+ car->SetStatus(STATUS_ABANDONED);
car->bIsLocked = true;
CCarCtrl::JoinCarWithRoadSystem(car);
car->AutoPilot.m_nCarMission = MISSION_NONE;
@@ -1997,7 +1997,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_STRAIGHT;
else
car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS;
- car->m_status = STATUS_PHYSICS;
+ car->SetStatus(STATUS_PHYSICS);
car->bEngineOn = true;
car->AutoPilot.m_nCruiseSpeed = Max(car->AutoPilot.m_nCruiseSpeed, 6);
car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
@@ -2087,7 +2087,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
{
CollectParameters(&m_nIp, 1);
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
- UpdateCompareFlag(car && car->m_status != STATUS_WRECKED && (car->IsBoat() || !car->bIsInWater));
+ UpdateCompareFlag(car && car->GetStatus() != STATUS_WRECKED && (car->IsBoat() || !car->bIsInWater));
return 0;
}
case COMMAND_SET_CAR_CRUISE_SPEED:
@@ -2626,7 +2626,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
{
CollectParameters(&m_nIp, 1);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
- UpdateCompareFlag(!pVehicle || pVehicle->m_status == STATUS_WRECKED || !pVehicle->IsBoat() && pVehicle->bIsInWater);
+ UpdateCompareFlag(!pVehicle || pVehicle->GetStatus() == STATUS_WRECKED || !pVehicle->IsBoat() && pVehicle->bIsInWater);
return 0;
}
case COMMAND_SET_CHAR_THREAT_SEARCH:
@@ -2753,7 +2753,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
pPed->m_pMyVehicle = pVehicle;
pPed->m_pMyVehicle->RegisterReference((CEntity**)&pPed->m_pMyVehicle);
pPed->bInVehicle = true;
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
if (!pVehicle->IsBoat())
pVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
pVehicle->bEngineOn = true;
@@ -2786,7 +2786,7 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
pPlayer->m_pPed->bRenderPedInCar = true;
if (pPlayer->m_pPed->m_pMyVehicle->pDriver == pPlayer->m_pPed){
pPlayer->m_pPed->m_pMyVehicle->RemoveDriver();
- pPlayer->m_pPed->m_pMyVehicle->m_status = STATUS_ABANDONED;
+ pPlayer->m_pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
pPlayer->m_pPed->m_pMyVehicle->bEngineOn = false;
pPlayer->m_pPed->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
}else{
@@ -2878,7 +2878,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
float y1 = *(float*)&ScriptParams[2];
float x2 = *(float*)&ScriptParams[3];
float y2 = *(float*)&ScriptParams[4];
- UpdateCompareFlag(pVehicle->m_status == STATUS_WRECKED &&
+ UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
pVehicle->IsWithinArea(x1, y1, x2, y2));
if (!ScriptParams[5])
return 0;
@@ -2898,7 +2898,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
float x2 = *(float*)&ScriptParams[4];
float y2 = *(float*)&ScriptParams[5];
float z2 = *(float*)&ScriptParams[6];
- UpdateCompareFlag(pVehicle->m_status == STATUS_WRECKED &&
+ UpdateCompareFlag(pVehicle->GetStatus() == STATUS_WRECKED &&
pVehicle->IsWithinArea(x1, y1, z1, x2, y2, z2));
if (!ScriptParams[7])
return 0;
@@ -3947,7 +3947,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
pPed->m_pMyVehicle->RegisterReference((CEntity**)&pPed->m_pMyVehicle);
pPed->bInVehicle = true;
pPed->SetPedState(PED_DRIVING);
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pPed->bUsesCollision = false;
#ifdef FIX_BUGS
AnimationId anim = pVehicle->GetDriverAnim();
@@ -5583,7 +5583,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTO_COORDS_STRAIGHT_ACCURATE;
else
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ACCURATE;
- pVehicle->m_status = STATUS_PHYSICS;
+ pVehicle->SetStatus(STATUS_PHYSICS);
pVehicle->bEngineOn = true;
pVehicle->AutoPilot.m_nCruiseSpeed = Max(6, pVehicle->AutoPilot.m_nCruiseSpeed);
pVehicle->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
@@ -5699,7 +5699,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
CWaterLevel::GetWaterLevel(pos.x, pos.y, pos.z, &pos.z, false);
pBoat->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ASTHECROWSWIMS;
pBoat->AutoPilot.m_vecDestinationCoors = pos;
- pBoat->m_status = STATUS_PHYSICS;
+ pBoat->SetStatus(STATUS_PHYSICS);
pBoat->AutoPilot.m_nCruiseSpeed = Max(6, pBoat->AutoPilot.m_nCruiseSpeed);
pBoat->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
return 0;
@@ -5712,7 +5712,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
assert(pVehicle->m_vehType == VEHICLE_TYPE_BOAT);
CBoat* pBoat = (CBoat*)pVehicle;
pBoat->AutoPilot.m_nCarMission = MISSION_NONE;
- pBoat->m_status = STATUS_PHYSICS;
+ pBoat->SetStatus(STATUS_PHYSICS);
pBoat->bEngineOn = false;
pBoat->AutoPilot.m_nCruiseSpeed = 0;
return 0;
@@ -6911,7 +6911,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
if (pPed->m_pMyVehicle){
if (pPed == pPed->m_pMyVehicle->pDriver){
pPed->m_pMyVehicle->RemoveDriver();
- pPed->m_pMyVehicle->m_status = STATUS_ABANDONED;
+ pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
if (pPed->m_pMyVehicle->m_nDoorLock == CARLOCK_LOCKED_INITIALLY)
pPed->m_pMyVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
if (pPed->m_nPedType == PEDTYPE_COP && pPed->m_pMyVehicle->IsLawEnforcementVehicle())
@@ -7108,7 +7108,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
pPed->bRenderPedInCar = true;
if (pPed->m_pMyVehicle->pDriver == pPed){
pPed->m_pMyVehicle->RemoveDriver();
- pPed->m_pMyVehicle->m_status = STATUS_ABANDONED;
+ pPed->m_pMyVehicle->SetStatus(STATUS_ABANDONED);
pPed->m_pMyVehicle->bEngineOn = false;
pPed->m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 0;
}else{
@@ -7779,7 +7779,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CollectParameters(&m_nIp, 2);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
- pVehicle->m_status = ScriptParams[1];
+ pVehicle->SetStatus((eEntityStatus)ScriptParams[1]);
return 0;
}
case COMMAND_IS_CHAR_MALE:
@@ -8156,7 +8156,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
car->GetPosition() = pos;
car->SetHeading(DEGTORAD(*(float*)&ScriptParams[3]));
CTheScripts::ClearSpaceForMissionEntity(pos, car);
- car->m_status = STATUS_ABANDONED;
+ car->SetStatus(STATUS_ABANDONED);
car->bIsLocked = true;
car->bIsCarParkVehicle = true;
CCarCtrl::JoinCarWithRoadSystem(car);
@@ -11229,7 +11229,7 @@ INITSAVEBUF
type = 0;
handle = 0;
} else {
- switch (pEntity->m_type) {
+ switch (pEntity->GetType()) {
case ENTITY_TYPE_BUILDING:
if (((CBuilding*)pEntity)->GetIsATreadable()) {
type = 1;
@@ -11371,7 +11371,7 @@ void CTheScripts::ClearSpaceForMissionEntity(const CVector& pos, CEntity* pEntit
}
if (cols <= 0)
continue;
- switch (pFound->m_type) {
+ switch (pFound->GetType()) {
case ENTITY_TYPE_VEHICLE:
{
printf("Will try to delete a vehicle where a mission entity should be\n");
diff --git a/src/control/TrafficLights.cpp b/src/control/TrafficLights.cpp
index c8d3f79f..44e14bdc 100644
--- a/src/control/TrafficLights.cpp
+++ b/src/control/TrafficLights.cpp
@@ -245,7 +245,7 @@ CTrafficLights::ShouldCarStopForLight(CVehicle *vehicle, bool alwaysStop)
}
}
- if(vehicle->m_status == STATUS_PHYSICS){
+ if(vehicle->GetStatus() == STATUS_PHYSICS){
node = vehicle->AutoPilot.m_nPreviousPathNodeInfo;
type = ThePaths.m_carPathLinks[node].trafficLightType;
if(type){