diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-04-30 15:45:45 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-04-30 15:45:45 +0200 |
commit | 7d758f3a9f7ad9b46cc9ab296166365597898bf5 (patch) | |
tree | 906b8d3f86c6ee6969bc553b1ea73ed6386409f0 /src/vehicles | |
parent | Fix downloading from PR (diff) | |
download | re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar.gz re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar.bz2 re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar.lz re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar.xz re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.tar.zst re3-7d758f3a9f7ad9b46cc9ab296166365597898bf5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/vehicles/Automobile.cpp | 80 | ||||
-rw-r--r-- | src/vehicles/Boat.cpp | 10 | ||||
-rw-r--r-- | src/vehicles/CarGen.cpp | 6 | ||||
-rw-r--r-- | src/vehicles/Cranes.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Heli.cpp | 4 | ||||
-rw-r--r-- | src/vehicles/Plane.cpp | 10 | ||||
-rw-r--r-- | src/vehicles/Train.cpp | 12 | ||||
-rw-r--r-- | src/vehicles/Vehicle.cpp | 14 |
8 files changed, 69 insertions, 69 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index bfb215d2..87c270c1 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -162,7 +162,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy) SetupSuspensionLines(); - m_status = STATUS_SIMPLE; + SetStatus(STATUS_SIMPLE); bUseCollisionRecords = true; m_nNumPassengers = 0; @@ -254,8 +254,8 @@ CAutomobile::ProcessControl(void) ProcessCarAlarm(); // Scan if this car sees the player committing any crimes - if(m_status != STATUS_ABANDONED && m_status != STATUS_WRECKED && - m_status != STATUS_PLAYER && m_status != STATUS_PLAYER_REMOTE && m_status != STATUS_PLAYER_DISABLED){ + if(GetStatus() != STATUS_ABANDONED && GetStatus() != STATUS_WRECKED && + GetStatus() != STATUS_PLAYER && GetStatus() != STATUS_PLAYER_REMOTE && GetStatus() != STATUS_PLAYER_DISABLED){ switch(GetModelIndex()) case MI_FBICAR: case MI_POLICE: @@ -318,7 +318,7 @@ CAutomobile::ProcessControl(void) // Set Center of Mass to make car more stable if(strongGrip1 || bCheat3) m_vecCentreOfMass.z = 0.3f*m_aSuspensionSpringLength[0] + -1.0f*m_fHeightAboveRoad; - else if(pHandling->Flags & HANDLING_NONPLAYER_STABILISER && m_status == STATUS_PHYSICS) + else if(pHandling->Flags & HANDLING_NONPLAYER_STABILISER && GetStatus() == STATUS_PHYSICS) m_vecCentreOfMass.z = pHandling->CentreOfMass.z - 0.2f*pHandling->Dimension.z; else m_vecCentreOfMass.z = pHandling->CentreOfMass.z; @@ -326,7 +326,7 @@ CAutomobile::ProcessControl(void) // Process depending on status bool playerRemote = false; - switch(m_status){ + switch(GetStatus()){ case STATUS_PLAYER_REMOTE: if(CPad::GetPad(0)->WeaponJustDown()){ BlowUpCar(FindPlayerPed()); @@ -356,7 +356,7 @@ CAutomobile::ProcessControl(void) PruneReferences(); - if(m_status == STATUS_PLAYER && !CRecordDataForChase::IsRecording()) + if(GetStatus() == STATUS_PLAYER && !CRecordDataForChase::IsRecording()) DoDriveByShootings(); } break; @@ -426,7 +426,7 @@ CAutomobile::ProcessControl(void) // Skip physics if object is found to have been static recently bool skipPhysics = false; - if(!bIsStuck && (m_status == STATUS_ABANDONED || m_status == STATUS_WRECKED)){ + if(!bIsStuck && (GetStatus() == STATUS_ABANDONED || GetStatus() == STATUS_WRECKED)){ bool makeStatic = false; float moveSpeedLimit, turnSpeedLimit, distanceLimit; @@ -436,7 +436,7 @@ CAutomobile::ProcessControl(void) m_aSuspensionSpringRatioPrev[3] != 1.0f) makeStatic = true; - if(m_status == STATUS_WRECKED){ + if(GetStatus() == STATUS_WRECKED){ moveSpeedLimit = 0.006f; turnSpeedLimit = 0.0015f; distanceLimit = 0.015f; @@ -494,7 +494,7 @@ CAutomobile::ProcessControl(void) default: if(CVehicle::bCheat3){ // Make vehicle jump when horn is sounded - if(m_status == STATUS_PLAYER && m_vecMoveSpeed.MagnitudeSqr() > sq(0.2f) && + if(GetStatus() == STATUS_PLAYER && m_vecMoveSpeed.MagnitudeSqr() > sq(0.2f) && // BUG: game checks [0] four times, instead of all wheels m_aSuspensionSpringRatio[0] < 1.0f && CPad::GetPad(0)->HornJustDown()){ @@ -713,7 +713,7 @@ CAutomobile::ProcessControl(void) } float traction; - if(m_status == STATUS_PHYSICS) + if(GetStatus() == STATUS_PHYSICS) traction = 0.004f * m_fTraction; else traction = 0.004f; @@ -764,7 +764,7 @@ CAutomobile::ProcessControl(void) m_aWheelColPoints[CARWHEEL_FRONT_LEFT].surfaceA = SURFACE_RUBBER29; float adhesion = CSurfaceTable::GetAdhesiveLimit(m_aWheelColPoints[CARWHEEL_FRONT_LEFT])*traction; - if(m_status == STATUS_PLAYER) + if(GetStatus() == STATUS_PLAYER) adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_FRONT_LEFT].surfaceB); WheelState[CARWHEEL_FRONT_LEFT] = m_aWheelState[CARWHEEL_FRONT_LEFT]; @@ -798,7 +798,7 @@ CAutomobile::ProcessControl(void) m_aWheelColPoints[CARWHEEL_FRONT_RIGHT].surfaceA = SURFACE_RUBBER29; float adhesion = CSurfaceTable::GetAdhesiveLimit(m_aWheelColPoints[CARWHEEL_FRONT_RIGHT])*traction; - if(m_status == STATUS_PLAYER) + if(GetStatus() == STATUS_PLAYER) adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_FRONT_RIGHT].surfaceB); WheelState[CARWHEEL_FRONT_RIGHT] = m_aWheelState[CARWHEEL_FRONT_RIGHT]; @@ -873,7 +873,7 @@ CAutomobile::ProcessControl(void) m_aWheelColPoints[CARWHEEL_REAR_LEFT].surfaceA = SURFACE_RUBBER29; float adhesion = CSurfaceTable::GetAdhesiveLimit(m_aWheelColPoints[CARWHEEL_REAR_LEFT])*traction; - if(m_status == STATUS_PLAYER) + if(GetStatus() == STATUS_PLAYER) adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_REAR_LEFT].surfaceB); WheelState[CARWHEEL_REAR_LEFT] = m_aWheelState[CARWHEEL_REAR_LEFT]; @@ -907,7 +907,7 @@ CAutomobile::ProcessControl(void) m_aWheelColPoints[CARWHEEL_REAR_RIGHT].surfaceA = SURFACE_RUBBER29; float adhesion = CSurfaceTable::GetAdhesiveLimit(m_aWheelColPoints[CARWHEEL_REAR_RIGHT])*traction; - if(m_status == STATUS_PLAYER) + if(GetStatus() == STATUS_PLAYER) adhesion *= CSurfaceTable::GetWetMultiplier(m_aWheelColPoints[CARWHEEL_REAR_RIGHT].surfaceB); WheelState[CARWHEEL_REAR_RIGHT] = m_aWheelState[CARWHEEL_REAR_RIGHT]; @@ -976,7 +976,7 @@ CAutomobile::ProcessControl(void) // Process horn - if(m_status != STATUS_PLAYER){ + if(GetStatus() != STATUS_PLAYER){ ReduceHornCounter(); }else{ if(GetModelIndex() == MI_MRWHOOP){ @@ -1008,7 +1008,7 @@ CAutomobile::ProcessControl(void) // Flying - if(m_status != STATUS_PLAYER && m_status != STATUS_PLAYER_REMOTE && m_status != STATUS_PHYSICS){ + if(GetStatus() != STATUS_PLAYER && GetStatus() != STATUS_PLAYER_REMOTE && GetStatus() != STATUS_PHYSICS){ if(GetModelIndex() == MI_MIAMI_RCRAIDER || GetModelIndex() == MI_MIAMI_SPARROW) m_aWheelSpeed[0] = Max(m_aWheelSpeed[0]-0.0005f, 0.0f); }else if((GetModelIndex() == MI_DODO || CVehicle::bAllDodosCheat) && @@ -1061,7 +1061,7 @@ CAutomobile::ProcessControl(void) // move fire forward if in first person if(this == FindPlayerVehicle() && TheCamera.GetLookingForwardFirstPerson()) - if(m_fHealth < 250.0f && m_status != STATUS_WRECKED){ + if(m_fHealth < 250.0f && GetStatus() != STATUS_WRECKED){ if(GetModelIndex() == MI_FIRETRUCK) damagePos += CVector(0.0f, 3.0f, -0.2f); else @@ -1071,7 +1071,7 @@ CAutomobile::ProcessControl(void) damagePos = GetMatrix()*damagePos; damagePos.z += 0.15f; - if(m_fHealth < 250.0f && m_status != STATUS_WRECKED){ + if(m_fHealth < 250.0f && GetStatus() != STATUS_WRECKED){ // Car is on fire CParticle::AddParticle(PARTICLE_CARFLAME, damagePos, @@ -1137,7 +1137,7 @@ CAutomobile::ProcessControl(void) // Shake pad - if((suspShake > 0.0f || surfShake > 0.0f) && m_status == STATUS_PLAYER){ + if((suspShake > 0.0f || surfShake > 0.0f) && GetStatus() == STATUS_PLAYER){ float speed = m_vecMoveSpeed.MagnitudeSqr(); if(speed > sq(0.1f)){ speed = Sqrt(speed); @@ -1198,7 +1198,7 @@ CAutomobile::ProcessControl(void) m_vecMoveFriction = CVector(0.0f, 0.0f, 0.0f); m_vecTurnFriction = CVector(0.0f, 0.0f, 0.0f); }else if(!skipPhysics && - (m_fGasPedal == 0.0f && brake == 0.0f || m_status == STATUS_WRECKED)){ + (m_fGasPedal == 0.0f && brake == 0.0f || GetStatus() == STATUS_WRECKED)){ if(Abs(m_vecMoveSpeed.x) < 0.005f && Abs(m_vecMoveSpeed.y) < 0.005f && Abs(m_vecMoveSpeed.z) < 0.005f){ @@ -1255,7 +1255,7 @@ CAutomobile::PreRender(void) } } }else{ - if(m_status == STATUS_SIMPLE){ + if(GetStatus() == STATUS_SIMPLE){ CMatrix mat; CVector pos; @@ -1285,8 +1285,8 @@ CAutomobile::PreRender(void) } int drawParticles = Abs(fwdSpeed) < 90.0f; - if(m_status == STATUS_SIMPLE || m_status == STATUS_PHYSICS || - m_status == STATUS_PLAYER || m_status == STATUS_PLAYER_PLAYBACKFROMBUFFER){ + if(GetStatus() == STATUS_SIMPLE || GetStatus() == STATUS_PHYSICS || + GetStatus() == STATUS_PLAYER || GetStatus() == STATUS_PLAYER_PLAYBACKFROMBUFFER){ bool rearSkidding = false; if(m_aWheelState[CARWHEEL_REAR_LEFT] == WHEEL_STATE_SKIDDING || m_aWheelState[CARWHEEL_REAR_RIGHT] == WHEEL_STATE_SKIDDING) @@ -1618,8 +1618,8 @@ CAutomobile::PreRender(void) CClock::GetHours() < 8 && CClock::GetMinutes() < (m_randomSeed & 0x3F) || m_randomSeed/50000.0f < CWeather::Foggyness || m_randomSeed/50000.0f < CWeather::WetRoads; - if(shouldLightsBeOn != bLightsOn && m_status != STATUS_WRECKED){ - if(m_status == STATUS_ABANDONED){ + if(shouldLightsBeOn != bLightsOn && GetStatus() != STATUS_WRECKED){ + if(GetStatus() == STATUS_ABANDONED){ // Turn off lights on abandoned vehicles only when we they're far away if(bLightsOn && Abs(TheCamera.GetPosition().x - GetPosition().x) + Abs(TheCamera.GetPosition().y - GetPosition().y) > 100.0f) @@ -1857,7 +1857,7 @@ CAutomobile::PreRender(void) }else{ // Lights off - if(m_status == STATUS_ABANDONED || m_status == STATUS_WRECKED) { + if(GetStatus() == STATUS_ABANDONED || GetStatus() == STATUS_WRECKED) { CShadows::StoreShadowForCar(this); return; } @@ -2139,7 +2139,7 @@ CAutomobile::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints) int i; CColModel *colModel; - if(m_status != STATUS_SIMPLE) + if(GetStatus() != STATUS_SIMPLE) bVehicleColProcessed = true; if(bUsingSpecialColModel) @@ -2178,7 +2178,7 @@ CAutomobile::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints) phys->RegisterReference((CEntity**)&m_aGroundPhysical[i]); m_aGroundOffset[i] = m_aWheelColPoints[i].point - phys->GetPosition(); - if(phys->GetModelIndex() == MI_BODYCAST && m_status == STATUS_PLAYER){ + if(phys->GetModelIndex() == MI_BODYCAST && GetStatus() == STATUS_PLAYER){ // damage body cast float speed = m_vecMoveSpeed.MagnitudeSqr(); if(speed > 0.1f){ @@ -2370,7 +2370,7 @@ CAutomobile::FireTruckControl(void) cannonDir = Multiply3x3(GetMatrix(), cannonDir); cannonDir.z += (CGeneral::GetRandomNumber()&0xF)/1000.0f; CWaterCannons::UpdateOne((uintptr)this, &cannonPos, &cannonDir); - }else if(m_status == STATUS_PHYSICS){ + }else if(GetStatus() == STATUS_PHYSICS){ CFire *fire = gFireManager.FindFurthestFire_NeverMindFireMen(GetPosition(), 10.0f, 35.0f); if(fire == nil) return; @@ -2531,7 +2531,7 @@ CAutomobile::HydraulicControl(void) CPlayerInfo *playerInfo = &CWorld::Players[CWorld::PlayerInFocus]; CColModel *specialColModel = &playerInfo->m_ColModel; - if(m_status != STATUS_PLAYER){ + if(GetStatus() != STATUS_PLAYER){ // reset hydraulics for non-player cars if(!bUsingSpecialColModel) @@ -3123,7 +3123,7 @@ CAutomobile::RcbanditCheck1CarWheels(CPtrList &list) mi = (CVehicleModelInfo*)CModelInfo::GetModelInfo(car->GetModelIndex()); for(i = 0; i < 4; i++){ - if(car->m_aSuspensionSpringRatioPrev[i] < 1.0f || car->m_status == STATUS_SIMPLE){ + if(car->m_aSuspensionSpringRatioPrev[i] < 1.0f || car->GetStatus() == STATUS_SIMPLE){ CVector wheelPos; CColSphere sph; mi->GetWheelPosn(i, wheelPos); @@ -3205,20 +3205,20 @@ CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece) // damage flipped over car if(GetUp().z < 0.0f && this != FindPlayerVehicle()){ - if(bNotDamagedUpsideDown || m_status == STATUS_PLAYER_REMOTE || bIsInWater) + if(bNotDamagedUpsideDown || GetStatus() == STATUS_PLAYER_REMOTE || bIsInWater) return; m_fHealth -= 4.0f*CTimer::GetTimeStep(); } - if(impulse > 25.0f && m_status != STATUS_WRECKED){ + if(impulse > 25.0f && GetStatus() != STATUS_WRECKED){ if(bIsLawEnforcer && FindPlayerVehicle() && FindPlayerVehicle() == m_pDamageEntity && - m_status != STATUS_ABANDONED && + GetStatus() != STATUS_ABANDONED && FindPlayerVehicle()->m_vecMoveSpeed.Magnitude() >= m_vecMoveSpeed.Magnitude() && FindPlayerVehicle()->m_vecMoveSpeed.Magnitude() > 0.1f) FindPlayerPed()->SetWantedLevelNoDrop(1); - if(m_status == STATUS_PLAYER && impulse > 50.0f){ + if(GetStatus() == STATUS_PLAYER && impulse > 50.0f){ uint8 freq = Min(0.4f*impulse*2000.0f/m_fMass + 100.0f, 250.0f); CPad::GetPad(0)->StartShake(40000/freq, freq); } @@ -3382,7 +3382,7 @@ CAutomobile::VehicleDamage(float impulse, uint16 damagedPiece) float damage = (impulse-25.0f)*pHandling->fCollisionDamageMultiplier*0.6f*damageMultiplier; - if(GetModelIndex() == MI_SECURICA && m_pDamageEntity && m_pDamageEntity->m_status == STATUS_PLAYER) + if(GetModelIndex() == MI_SECURICA && m_pDamageEntity && m_pDamageEntity->GetStatus() == STATUS_PLAYER) damage *= 7.0f; if(damage > 0.0f){ @@ -3816,7 +3816,7 @@ CAutomobile::BlowUpCar(CEntity *culprit) // explosion pushes vehicle up m_vecMoveSpeed.z += 0.13f; - m_status = STATUS_WRECKED; + SetStatus(STATUS_WRECKED); bRenderScorched = true; m_nTimeOfDeath = CTimer::GetTimeInMilliseconds(); Damage.FuckCarCompletely(); @@ -3933,8 +3933,8 @@ CAutomobile::BurstTyre(uint8 wheel) if(status == WHEEL_STATUS_OK){ Damage.SetWheelStatus(wheel, WHEEL_STATUS_BURST); - if(m_status == STATUS_SIMPLE){ - m_status = STATUS_PHYSICS; + if(GetStatus() == STATUS_SIMPLE){ + SetStatus(STATUS_PHYSICS); CCarCtrl::SwitchVehicleToRealPhysics(this); } @@ -4133,7 +4133,7 @@ CAutomobile::HasCarStoppedBecauseOfLight(void) { int i; - if(m_status != STATUS_SIMPLE && m_status != STATUS_PHYSICS) + if(GetStatus() != STATUS_SIMPLE && GetStatus() != STATUS_PHYSICS) return false; if(AutoPilot.m_nCurrentRouteNode && AutoPilot.m_nNextRouteNode){ diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 14eb2f05..615511bd 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -137,7 +137,7 @@ CBoat::ProcessControl(void) ProcessCarAlarm(); - switch(m_status){ + switch(GetStatus()){ case STATUS_PLAYER: m_bIsAnchored = false; m_fOrientation = INVALID_ORIENTATION; @@ -176,7 +176,7 @@ CBoat::ProcessControl(void) } float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse; - if(collisionDamage > 25.0f && m_status != STATUS_WRECKED && m_fHealth >= 150.0f){ + if(collisionDamage > 25.0f && GetStatus() != STATUS_WRECKED && m_fHealth >= 150.0f){ float prevHealth = m_fHealth; if(this == FindPlayerVehicle()){ if(bTakeLessDamage) @@ -199,7 +199,7 @@ CBoat::ProcessControl(void) } // Damage particles - if(m_fHealth <= 600.0f && m_status != STATUS_WRECKED && + if(m_fHealth <= 600.0f && GetStatus() != STATUS_WRECKED && Abs(GetPosition().x - TheCamera.GetPosition().x) < 200.0f && Abs(GetPosition().y - TheCamera.GetPosition().y) < 200.0f){ float speedSq = m_vecMoveSpeed.MagnitudeSqr(); @@ -326,7 +326,7 @@ CBoat::ProcessControl(void) // Spray some particles CVector jetDir = -0.04f * force; if(m_fGasPedal > 0.0f){ - if(m_status == STATUS_PLAYER){ + if(GetStatus() == STATUS_PLAYER){ bool cameraHack = TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN || TheCamera.WhoIsInControlOfTheCamera == CAMCONTROL_OBBE; CVector sternPos = GetColModel()->boundingBox.min; @@ -597,7 +597,7 @@ CBoat::BlowUpCar(CEntity *culprit) // explosion pushes vehicle up m_vecMoveSpeed.z += 0.13f; - m_status = STATUS_WRECKED; + SetStatus(STATUS_WRECKED); bRenderScorched = true; m_fHealth = 0.0; diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp index 64743929..c04e8c35 100644 --- a/src/vehicles/CarGen.cpp +++ b/src/vehicles/CarGen.cpp @@ -61,7 +61,7 @@ void CCarGenerator::DoInternalProcessing() pos.z += pBoat->GetDistanceFromCentreOfMassToBaseOfModel(); pBoat->GetPosition() = pos; pBoat->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle)); - pBoat->m_status = STATUS_ABANDONED; + pBoat->SetStatus(STATUS_ABANDONED); pBoat->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(pBoat); if (CGeneral::GetRandomNumberInRange(0, 100) < m_nAlarm) @@ -95,7 +95,7 @@ void CCarGenerator::DoInternalProcessing() pos.z += pCar->GetDistanceFromCentreOfMassToBaseOfModel(); pCar->GetPosition() = pos; pCar->SetOrientation(0.0f, 0.0f, DEGTORAD(m_fAngle)); - pCar->m_status = STATUS_ABANDONED; + pCar->SetStatus(STATUS_ABANDONED); pCar->bLightsOn = false; pCar->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(pCar); @@ -130,7 +130,7 @@ void CCarGenerator::Process() m_nVehicleHandle = -1; return; } - if (pVehicle->m_status != STATUS_PLAYER) + if (pVehicle->GetStatus() != STATUS_PLAYER) return; m_nTimer += 60000; m_nVehicleHandle = -1; diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp index 7d2160d9..725c9e87 100644 --- a/src/vehicles/Cranes.cpp +++ b/src/vehicles/Cranes.cpp @@ -416,7 +416,7 @@ void CCrane::FindCarInSectorList(CPtrList* pList) Abs(pVehicle->GetMoveSpeed().y) >= CAR_MOVING_SPEED_THRESHOLD || Abs(pVehicle->GetMoveSpeed().z) >= CAR_MOVING_SPEED_THRESHOLD) continue; - if (!pVehicle->IsCar() || pVehicle->m_status == STATUS_WRECKED || pVehicle->m_fHealth < 250.0f) + if (!pVehicle->IsCar() || pVehicle->GetStatus() == STATUS_WRECKED || pVehicle->m_fHealth < 250.0f) continue; if (!DoesCranePickUpThisCarType(pVehicle->GetModelIndex()) || m_bIsMilitaryCrane && CCranes::DoesMilitaryCraneHaveThisOneAlready(pVehicle->GetModelIndex())) { diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp index 0073a5ad..dd2c4e57 100644 --- a/src/vehicles/Heli.cpp +++ b/src/vehicles/Heli.cpp @@ -77,7 +77,7 @@ CHeli::CHeli(int32 id, uint8 CreatedBy) m_fHeliDustZ[i] = -50.0f; m_nPoliceShoutTimer = CTimer::GetTimeInMilliseconds(); - m_status = STATUS_HELI; + SetStatus(STATUS_HELI); m_bTestRight = true; m_fTargetOffset = 0.0f; m_fSearchLightX = m_fSearchLightY = 0.0f; @@ -810,7 +810,7 @@ GenerateHeli(bool catalina) if(catalina) heli->GetMatrix().SetRotateZOnly(DEGTORAD(270.0f)); // game actually uses 3.14 here - heli->m_status = STATUS_ABANDONED; + heli->SetStatus(STATUS_ABANDONED); int id = -1; bool found = false; diff --git a/src/vehicles/Plane.cpp b/src/vehicles/Plane.cpp index 273ac54a..10ce225a 100644 --- a/src/vehicles/Plane.cpp +++ b/src/vehicles/Plane.cpp @@ -81,7 +81,7 @@ CPlane::CPlane(int32 id, uint8 CreatedBy) m_bIsDrugRunCesna = false; m_bIsDropOffCesna = false; - m_status = STATUS_PLANE; + SetStatus(STATUS_PLANE); bIsBIGBuilding = true; m_level = LEVEL_NONE; } @@ -754,7 +754,7 @@ CPlane::InitPlanes(void) for(i = 0; i < 3; i++){ CPlane *plane = new CPlane(MI_AIRTRAIN, PERMANENT_VEHICLE); plane->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - plane->m_status = STATUS_ABANDONED; + plane->SetStatus(STATUS_ABANDONED); plane->bIsLocked = true; plane->m_nPlaneId = i; plane->m_nCurPathNode = 0; @@ -768,7 +768,7 @@ CPlane::InitPlanes(void) for(i = 0; i < 3; i++){ CPlane *plane = new CPlane(MI_DEADDODO, PERMANENT_VEHICLE); plane->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - plane->m_status = STATUS_ABANDONED; + plane->SetStatus(STATUS_ABANDONED); plane->bIsLocked = true; plane->m_nPlaneId = i; plane->m_nCurPathNode = 0; @@ -926,7 +926,7 @@ CPlane::CreateIncomingCesna(void) } pDrugRunCesna = new CPlane(MI_DEADDODO, PERMANENT_VEHICLE); pDrugRunCesna->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - pDrugRunCesna->m_status = STATUS_ABANDONED; + pDrugRunCesna->SetStatus(STATUS_ABANDONED); pDrugRunCesna->bIsLocked = true; pDrugRunCesna->m_nPlaneId = 0; pDrugRunCesna->m_nCurPathNode = 0; @@ -948,7 +948,7 @@ CPlane::CreateDropOffCesna(void) } pDropOffCesna = new CPlane(MI_DEADDODO, PERMANENT_VEHICLE); pDropOffCesna->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - pDropOffCesna->m_status = STATUS_ABANDONED; + pDropOffCesna->SetStatus(STATUS_ABANDONED); pDropOffCesna->bIsLocked = true; pDropOffCesna->m_nPlaneId = 0; pDropOffCesna->m_nCurPathNode = 0; diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp index 0d1ff9b0..07d81501 100644 --- a/src/vehicles/Train.cpp +++ b/src/vehicles/Train.cpp @@ -59,7 +59,7 @@ CTrain::CTrain(int32 id, uint8 CreatedBy) m_nDoorState = TRAIN_DOOR_CLOSED; bUsesCollision = true; - m_status = STATUS_TRAIN_MOVING; + SetStatus(STATUS_TRAIN_MOVING); } void @@ -177,11 +177,11 @@ CTrain::ProcessControl(void) m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f); if(engineTrackSpeed[m_nWagonGroup] > 0.001f){ - m_status = STATUS_TRAIN_MOVING; + SetStatus(STATUS_TRAIN_MOVING); m_bTrainStopping = false; m_bProcessDoor = true; }else{ - m_status = STATUS_TRAIN_NOT_MOVING; + SetStatus(STATUS_TRAIN_NOT_MOVING); m_bTrainStopping = true; } @@ -252,7 +252,7 @@ CTrain::ProcessControl(void) } // Hit stuff - if(m_bIsFirstWagon && m_status == STATUS_TRAIN_MOVING){ + if(m_bIsFirstWagon && GetStatus()== STATUS_TRAIN_MOVING){ CVector front = GetPosition() + GetForward()*GetColModel()->boundingBox.max.y + m_vecMoveSpeed*CTimer::GetTimeStep(); int x, xmin, xmax; @@ -440,7 +440,7 @@ CTrain::InitTrains(void) for(i = 0; i < 5; i++){ train = new CTrain(MI_TRAIN, PERMANENT_VEHICLE); train->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - train->m_status = STATUS_ABANDONED; + train->SetStatus(STATUS_ABANDONED); train->bIsLocked = true; train->m_fWagonPosition = wagonPositions[i]; train->m_bIsFirstWagon = firstWagon[i]; @@ -459,7 +459,7 @@ CTrain::InitTrains(void) for(i = 0; i < 8; i++){ train = new CTrain(MI_TRAIN, PERMANENT_VEHICLE); train->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f); - train->m_status = STATUS_ABANDONED; + train->SetStatus(STATUS_ABANDONED); train->bIsLocked = true; train->m_fWagonPosition = wagonPositions_S[i]; train->m_bIsFirstWagon = firstWagon_S[i]; diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index d0ccd31b..590e68f2 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -393,7 +393,7 @@ CVehicle::FlyingControl(eFlightModel flightModel) m_vecMoveSpeed.x *= rmX; m_vecMoveSpeed.y *= rmY; m_vecMoveSpeed.z *= rmZ; - if (m_status != STATUS_PLAYER && m_status != STATUS_PLAYER_REMOTE) + if (GetStatus() != STATUS_PLAYER && GetStatus() != STATUS_PLAYER_REMOTE) return; float fThrust; if (bCheat5) @@ -623,13 +623,13 @@ CVehicle::InflictDamage(CEntity* damagedBy, eWeaponType weaponType, float damage } if (m_fHealth > 0.0f) { if (VehicleCreatedBy == RANDOM_VEHICLE && pDriver && - (m_status == STATUS_SIMPLE || m_status == STATUS_PHYSICS) && + (GetStatus() == STATUS_SIMPLE || GetStatus() == STATUS_PHYSICS) && AutoPilot.m_nCarMission == MISSION_CRUISE) { if (m_randomSeed < DAMAGE_FLEE_IN_CAR_PROBABILITY_VALUE) { CCarCtrl::SwitchVehicleToRealPhysics(this); AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS; AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * pHandling->Transmission.fUnkMaxVelocity; - m_status = STATUS_PHYSICS; + SetStatus(STATUS_PHYSICS); } } m_nLastWeaponDamage = weaponType; @@ -639,11 +639,11 @@ CVehicle::InflictDamage(CEntity* damagedBy, eWeaponType weaponType, float damage if (VehicleCreatedBy == RANDOM_VEHICLE && (m_fHealth < DAMAGE_HEALTH_TO_FLEE_ALWAYS || bFrightensDriver && m_randomSeed > DAMAGE_FLEE_ON_FOOT_PROBABILITY_VALUE)) { - switch (m_status) { + switch (GetStatus()) { case STATUS_SIMPLE: case STATUS_PHYSICS: if (pDriver) { - m_status = STATUS_ABANDONED; + SetStatus(STATUS_ABANDONED); pDriver->bFleeAfterExitingCar = true; pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); } @@ -871,7 +871,7 @@ CVehicle::UsesSiren(uint32 id) bool CVehicle::IsVehicleNormal(void) { - if (!pDriver || m_nNumPassengers != 0 || m_status == STATUS_WRECKED) + if (!pDriver || m_nNumPassengers != 0 || GetStatus() == STATUS_WRECKED) return false; switch (GetModelIndex()){ case MI_FIRETRUCK: @@ -1141,7 +1141,7 @@ CVehicle::AddPassenger(CPed *passenger, uint8 n) void CVehicle::RemoveDriver(void) { - m_status = STATUS_ABANDONED; + SetStatus(STATUS_ABANDONED); pDriver = nil; } |