diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-04-30 16:45:45 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-04-30 16:45:45 +0300 |
commit | 7d758f3a9f7ad9b46cc9ab296166365597898bf5 (patch) | |
tree | 906b8d3f86c6ee6969bc553b1ea73ed6386409f0 /src/core | |
parent | cf5a404f6be036fc95692c5b50b277e0f15a8299 (diff) |
Adding getters and setters for type and status
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/AnimViewer.cpp | 4 | ||||
-rw-r--r-- | src/core/Cam.cpp | 4 | ||||
-rw-r--r-- | src/core/Pad.cpp | 2 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 10 | ||||
-rw-r--r-- | src/core/Pools.cpp | 4 | ||||
-rw-r--r-- | src/core/Wanted.cpp | 2 | ||||
-rw-r--r-- | src/core/World.cpp | 14 | ||||
-rw-r--r-- | src/core/re3.cpp | 2 |
8 files changed, 21 insertions, 21 deletions
diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index 36ea20b7..7afda509 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -278,7 +278,7 @@ CAnimViewer::Update(void) // } } else { newEntity = pTarget = new CAutomobile(modelId, RANDOM_VEHICLE); - newEntity->m_status = STATUS_ABANDONED; + newEntity->SetStatus(STATUS_ABANDONED); } newEntity->bIsStuck = true; } else if (modelInfo->m_type == MITYPE_PED) { @@ -296,7 +296,7 @@ CAnimViewer::Update(void) CWorld::Add(newEntity); TheCamera.TakeControl(pTarget, CCam::MODE_MODELVIEW, JUMP_CUT, CAMCONTROL_SCRIPT); } - if (pTarget->m_type == ENTITY_TYPE_VEHICLE || pTarget->m_type == ENTITY_TYPE_PED || pTarget->m_type == ENTITY_TYPE_OBJECT) { + if (pTarget->IsVehicle() || pTarget->IsPed() || pTarget->IsObject()) { ((CPhysical*)pTarget)->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); } pTarget->GetPosition().z = 0.0f; diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 801652cb..43d817b7 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -4683,7 +4683,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, static float ZmTwoAlphaOffsetLCS[] = { 0.1f, 0.08f, 0.3f, 0.08f, 0.08f }; static float ZmThreeAlphaOffsetLCS[] = { 0.065f, 0.05f, 0.15f, 0.06f, 0.08f }; - if (isHeli && car->m_status == STATUS_PLAYER_REMOTE) + if (isHeli && car->GetStatus() == STATUS_PLAYER_REMOTE) zoomModeAlphaOffset = ZmTwoAlphaOffsetLCS[alphaArrPos]; else { switch ((int)TheCamera.CarZoomIndicator) { @@ -4712,7 +4712,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, float minDistForThisCar = approxCarLength * CARCAM_SET[camSetArrPos][3]; - if (!isHeli || car->m_status == STATUS_PLAYER_REMOTE) { + if (!isHeli || car->GetStatus() == STATUS_PLAYER_REMOTE) { float radiusToStayOutside = colMaxZ * CARCAM_SET[camSetArrPos][0] - CARCAM_SET[camSetArrPos][2]; if (radiusToStayOutside > 0.0f) { TargetCoors.z += radiusToStayOutside; diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index a72f51c0..7dbadd74 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -107,7 +107,7 @@ void TankCheat() tank->GetPosition() = pos; tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f)); - tank->m_status = STATUS_ABANDONED; + tank->SetStatus(STATUS_ABANDONED); tank->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(tank); } diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index e92f7568..7dadbf28 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -328,7 +328,7 @@ CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, continue; car->m_scanCode = CWorld::GetCurrentScanCode(); - if (car->m_status != STATUS_WRECKED && car->m_status != STATUS_TRAIN_MOVING + if (car->GetStatus() != STATUS_WRECKED && car->GetStatus() != STATUS_TRAIN_MOVING && (car->GetUp().z > 0.3f || (car->IsVehicle() && ((CVehicle*)car)->m_vehType == VEHICLE_TYPE_BIKE))) { CVector carCentre = car->GetBoundCentre(); @@ -413,7 +413,7 @@ CPlayerInfo::Process(void) // This condition will always return true, else block was probably WIP Miami code. if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) { - if (veh->m_status != STATUS_WRECKED && veh->m_status != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { + if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) { m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); } @@ -454,7 +454,7 @@ CPlayerInfo::Process(void) weAreOnBoat = true; m_pPed->bOnBoat = true; #ifdef VC_PED_PORTS - if (carBelow->m_status != STATUS_WRECKED && carBelow->GetUp().z > 0.3f) + if (carBelow->GetStatus() != STATUS_WRECKED && carBelow->GetUp().z > 0.3f) #else if (carBelow->m_status != STATUS_WRECKED) #endif @@ -491,7 +491,7 @@ CPlayerInfo::Process(void) } // carBelow is now closest vehicle if (carBelow && !weAreOnBoat) { - if (carBelow->m_status == STATUS_TRAIN_NOT_MOVING) { + if (carBelow->GetStatus() == STATUS_TRAIN_NOT_MOVING) { m_pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_PASSENGER, carBelow); } else if (carBelow->IsBoat()) { if (!carBelow->pDriver) { @@ -526,7 +526,7 @@ CPlayerInfo::Process(void) m_bInRemoteMode = false; CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = nil; if (FindPlayerVehicle()) { - FindPlayerVehicle()->m_status = STATUS_PLAYER; + FindPlayerVehicle()->SetStatus(STATUS_PLAYER); } } } diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index 4f4588da..b9a78b0b 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -161,8 +161,8 @@ INITSAVEBUF pVehicle->m_nTimeOfDeath = pBufferVehicle->m_nTimeOfDeath; #endif pVehicle->m_nDoorLock = pBufferVehicle->m_nDoorLock; - pVehicle->m_status = pBufferVehicle->m_status; - pVehicle->m_type = pBufferVehicle->m_type; + pVehicle->SetStatus(pBufferVehicle->GetStatus()); + pVehicle->SetType(pBufferVehicle->GetType()); (pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0]; (pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1]; pVehicle->AutoPilot = pBufferVehicle->AutoPilot; diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp index 6f5fdf06..7508c9f4 100644 --- a/src/core/Wanted.cpp +++ b/src/core/Wanted.cpp @@ -352,7 +352,7 @@ CWanted::WorkOutPolicePresence(CVector posn, float radius) vehicle->bIsLawEnforcer && IsPoliceVehicleModel(vehicle->GetModelIndex()) && vehicle != FindPlayerVehicle() && - vehicle->m_status != STATUS_ABANDONED && vehicle->m_status != STATUS_WRECKED && + vehicle->GetStatus() != STATUS_ABANDONED && vehicle->GetStatus() != STATUS_WRECKED && (posn - vehicle->GetPosition()).Magnitude() < radius) numPolice++; } diff --git a/src/core/World.cpp b/src/core/World.cpp index b2a01b80..4b2ca76e 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1867,7 +1867,7 @@ CWorld::SetCarsOnFire(float x, float y, float z, float radius, CEntity *reason) int poolSize = CPools::GetVehiclePool()->GetSize(); for(int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) { CVehicle *veh = CPools::GetVehiclePool()->GetSlot(poolIndex); - if(veh && veh->m_status != STATUS_WRECKED && !veh->m_pCarFire && !veh->bFireProof) { + if(veh && veh->GetStatus() != STATUS_WRECKED && !veh->m_pCarFire && !veh->bFireProof) { if(Abs(veh->GetPosition().z - z) < 5.0f && Abs(veh->GetPosition().x - x) < radius && Abs(veh->GetPosition().y - y) < radius) gFireManager.StartFire(veh, reason, 0.8f, true); @@ -1928,7 +1928,7 @@ CWorld::Process(void) if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP && RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) { RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), - 0.02f * (csObj->m_type == ENTITY_TYPE_OBJECT + 0.02f * (csObj->IsObject() ? CTimer::GetTimeStepNonClipped() : CTimer::GetTimeStep())); } @@ -1946,7 +1946,7 @@ CWorld::Process(void) if(movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP && RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) { RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), - 0.02f * (movingEnt->m_type == ENTITY_TYPE_OBJECT + 0.02f * (movingEnt->IsObject() ? CTimer::GetTimeStepNonClipped() : CTimer::GetTimeStep())); } @@ -2030,7 +2030,7 @@ CWorld::Process(void) movingEnt->UpdateRwFrame(); if(!movingEnt->bIsInSafePosition) { movingEnt->bIsStuck = true; - if(movingEnt->m_status == STATUS_PLAYER) { + if(movingEnt->GetStatus() == STATUS_PLAYER) { printf("STUCK: Final Step: Player Entity %d Is Stuck\n", movingEnt->m_modelIndex); movingEnt->m_vecMoveSpeed *= 0.3f; @@ -2178,10 +2178,10 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa pEntity->ApplyTurnForce(vecForceDir.x, vecForceDir.y, vecForceDir.z, 0.0f, 0.0f, fPointZ); } - switch(pEntity->m_type) { + switch(pEntity->GetType()) { case ENTITY_TYPE_VEHICLE: - if(pEntity->m_status == STATUS_SIMPLE) { - pEntity->m_status = STATUS_PHYSICS; + if(pEntity->GetStatus() == STATUS_SIMPLE) { + pEntity->SetStatus(STATUS_PHYSICS); CCarCtrl::SwitchVehicleToRealPhysics(pVehicle); } pVehicle->InflictDamage(pCreator, WEAPONTYPE_EXPLOSION, diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 2a9cbc77..7bb18688 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -121,7 +121,7 @@ SpawnCar(int id) v->GetPosition().z += 4.0f; v->SetOrientation(0.0f, 0.0f, 3.49f); - v->m_status = STATUS_ABANDONED; + v->SetStatus(STATUS_ABANDONED); v->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(v); } |