summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/peds/CivilianPed.h2
-rw-r--r--src/peds/CopPed.cpp16
-rw-r--r--src/peds/CopPed.h4
-rw-r--r--src/peds/DummyPed.h3
-rw-r--r--src/peds/EmergencyPed.h2
-rw-r--r--src/peds/Gangs.h2
-rw-r--r--src/peds/Ped.cpp392
-rw-r--r--src/peds/Ped.h22
-rw-r--r--src/peds/PedIK.cpp11
-rw-r--r--src/peds/PedIK.h3
-rw-r--r--src/peds/PedPlacement.cpp2
-rw-r--r--src/peds/PedPlacement.h2
-rw-r--r--src/peds/PedStats.h3
-rw-r--r--src/peds/PedType.h2
-rw-r--r--src/peds/PlayerPed.cpp41
-rw-r--r--src/peds/PlayerPed.h9
-rw-r--r--src/peds/Population.cpp49
17 files changed, 326 insertions, 239 deletions
diff --git a/src/peds/CivilianPed.h b/src/peds/CivilianPed.h
index 88d034c8..8418a99f 100644
--- a/src/peds/CivilianPed.h
+++ b/src/peds/CivilianPed.h
@@ -12,5 +12,5 @@ public:
void ProcessControl(void);
};
#ifndef PED_SKIN
-static_assert(sizeof(CCivilianPed) == 0x53C, "CCivilianPed: error");
+VALIDATE_SIZE(CCivilianPed, 0x53C);
#endif
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 3fc8b8ca..99e8c1ae 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -73,7 +73,7 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
// VC also initializes in here, but as nil
#ifdef FIX_BUGS
- m_wRoadblockNode = -1;
+ m_nRoadblockNode = -1;
#endif
}
@@ -132,7 +132,7 @@ CCopPed::SetArrestPlayer(CPed *player)
player->m_pMyVehicle->m_nNumGettingIn = 0;
player->m_pMyVehicle->m_nGettingInFlags = 0;
player->m_pMyVehicle->bIsHandbrakeOn = true;
- player->m_pMyVehicle->m_status = STATUS_PLAYER_DISABLED;
+ player->m_pMyVehicle->SetStatus(STATUS_PLAYER_DISABLED);
}
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_UNARMED)
SetCurrentWeapon(WEAPONTYPE_COLT45);
@@ -305,9 +305,9 @@ CCopPed::CopAI(void)
m_bZoneDisabled = true;
m_bIsDisabledCop = true;
#ifdef FIX_BUGS
- m_wRoadblockNode = -1;
+ m_nRoadblockNode = -1;
#else
- m_wRoadblockNode = 0;
+ m_nRoadblockNode = 0;
#endif
bKindaStayInSamePlace = true;
bIsRunning = false;
@@ -424,8 +424,8 @@ CCopPed::CopAI(void)
// VC checks for != nil compared to buggy behaviour of III. I check for != -1 here.
#ifdef VC_PED_PORTS
float dotProd;
- if (m_wRoadblockNode != -1) {
- CTreadable *roadBlockRoad = ThePaths.m_mapObjects[CRoadBlocks::RoadBlockObjects[m_wRoadblockNode]];
+ if (m_nRoadblockNode != -1) {
+ CTreadable *roadBlockRoad = ThePaths.m_mapObjects[CRoadBlocks::RoadBlockObjects[m_nRoadblockNode]];
dotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockRoad->GetPosition(), GetPosition() - roadBlockRoad->GetPosition());
} else
dotProd = -1.0f;
@@ -437,10 +437,10 @@ CCopPed::CopAI(void)
float copRoadDotProd, targetRoadDotProd;
#else
float copRoadDotProd = 1.0f, targetRoadDotProd = 1.0f;
- if (m_wRoadblockNode != -1)
+ if (m_nRoadblockNode != -1)
#endif
{
- CTreadable* roadBlockRoad = ThePaths.m_mapObjects[CRoadBlocks::RoadBlockObjects[m_wRoadblockNode]];
+ CTreadable* roadBlockRoad = ThePaths.m_mapObjects[CRoadBlocks::RoadBlockObjects[m_nRoadblockNode]];
CVector2D roadFwd = roadBlockRoad->GetForward();
copRoadDotProd = DotProduct2D(GetPosition() - roadBlockRoad->GetPosition(), roadFwd);
targetRoadDotProd = DotProduct2D(playerOrHisVeh->GetPosition() - roadBlockRoad->GetPosition(), roadFwd);
diff --git a/src/peds/CopPed.h b/src/peds/CopPed.h
index e9780035..5346d9a1 100644
--- a/src/peds/CopPed.h
+++ b/src/peds/CopPed.h
@@ -12,7 +12,7 @@ enum eCopType
class CCopPed : public CPed
{
public:
- int16 m_wRoadblockNode;
+ int16 m_nRoadblockNode;
float m_fDistanceToTarget;
bool m_bIsInPursuit;
bool m_bIsDisabledCop;
@@ -37,5 +37,5 @@ public:
};
#ifndef PED_SKIN
-static_assert(sizeof(CCopPed) == 0x558, "CCopPed: error");
+VALIDATE_SIZE(CCopPed, 0x558);
#endif
diff --git a/src/peds/DummyPed.h b/src/peds/DummyPed.h
index af633dc4..ea617c76 100644
--- a/src/peds/DummyPed.h
+++ b/src/peds/DummyPed.h
@@ -8,4 +8,5 @@ class CDummyPed : CDummy
int32 pedType;
int32 unknown;
};
-static_assert(sizeof(CDummyPed) == 0x70, "CDummyPed: error");
+
+VALIDATE_SIZE(CDummyPed, 0x70);
diff --git a/src/peds/EmergencyPed.h b/src/peds/EmergencyPed.h
index 6d3dac79..390ba0bd 100644
--- a/src/peds/EmergencyPed.h
+++ b/src/peds/EmergencyPed.h
@@ -37,5 +37,5 @@ public:
void MedicAI(void);
};
#ifndef PED_SKIN
-static_assert(sizeof(CEmergencyPed) == 0x554, "CEmergencyPed: error");
+VALIDATE_SIZE(CEmergencyPed, 0x554);
#endif
diff --git a/src/peds/Gangs.h b/src/peds/Gangs.h
index dd7a7f93..c8ea2916 100644
--- a/src/peds/Gangs.h
+++ b/src/peds/Gangs.h
@@ -10,7 +10,7 @@ struct CGangInfo
CGangInfo();
};
-static_assert(sizeof(CGangInfo) == 0x10, "CGangInfo: error");
+VALIDATE_SIZE(CGangInfo, 0x10);
enum {
GANG_MAFIA = 0,
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index dcb167f0..78f4b586 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -414,8 +414,8 @@ CPed::FlagToDestroyWhenNextProcessed(void)
return;
if (m_pMyVehicle->pDriver == this){
m_pMyVehicle->pDriver = nil;
- if (IsPlayer() && m_pMyVehicle->m_status != STATUS_WRECKED)
- m_pMyVehicle->m_status = STATUS_ABANDONED;
+ if (IsPlayer() && m_pMyVehicle->GetStatus() != STATUS_WRECKED)
+ m_pMyVehicle->SetStatus(STATUS_ABANDONED);
}else{
m_pMyVehicle->RemovePassenger(this);
}
@@ -522,7 +522,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
m_fElasticity = 0.05f;
bIsStanding = false;
- m_ped_flagA2 = false;
+ bWasStanding = false;
bIsAttacking = false;
bIsPointingGunAt = false;
bIsLooking = false;
@@ -1667,7 +1667,7 @@ CPed::GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float seatP
CVector vehDoorOffset;
float seatOffset;
- vehModel = (CVehicleModelInfo*) CModelInfo::GetModelInfo(veh->m_modelIndex);
+ vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(veh->GetModelIndex());
if (veh->bIsVan && (component == CAR_DOOR_LR || component == CAR_DOOR_RR)) {
seatOffset = 0.0f;
vehDoorOffset = vecPedVanRearDoorAnimOffset;
@@ -2019,7 +2019,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
}
if (seatPosMult > 0.2f || vehIsUpsideDown) {
- GetPosition() = neededPos;
+ SetPosition(neededPos);
SetHeading(m_fRotationCur);
} else {
@@ -2096,10 +2096,10 @@ CPed::PlayFootSteps(void)
float walkRunAssocBlend = 0.0f, idleAssocBlend = 0.0f;
for (; assoc; assoc = RpAnimBlendGetNextAssociation(assoc)) {
- if (assoc->flags & ASSOC_FLAG80) {
+ if (assoc->flags & ASSOC_WALK) {
walkRunAssoc = assoc;
walkRunAssocBlend += assoc->blendAmount;
- } else if ((assoc->flags & ASSOC_FLAG200) == 0) {
+ } else if ((assoc->flags & ASSOC_NOWALK) == 0) {
idleAssocBlend += assoc->blendAmount;
}
}
@@ -2351,7 +2351,7 @@ CPed::SetModelIndex(uint32 mi)
CEntity::SetModelIndex(mi);
RpAnimBlendClumpInit(GetClump());
RpAnimBlendClumpFillFrameArray(GetClump(), m_pFrames);
- CPedModelInfo *modelInfo = (CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex);
+ CPedModelInfo *modelInfo = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex());
SetPedStats(modelInfo->m_pedStatType);
m_headingRate = m_pedStats->m_headingChangeRate;
m_animGroup = (AssocGroupId) modelInfo->m_animGroup;
@@ -2401,7 +2401,7 @@ void
CPed::Teleport(CVector pos)
{
CWorld::Remove(this);
- GetPosition() = pos;
+ SetPosition(pos);
bIsStanding = false;
m_nPedStateTimer = 0;
m_actionX = 0.0f;
@@ -2919,7 +2919,7 @@ CPed::SetObjective(eObjective newObj, void *entity)
if (newObj == OBJECTIVE_SOLICIT) {
m_objectiveTimer = CTimer::GetTimeInMilliseconds() + 10000;
} else if (m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER && CharCreatedBy == MISSION_CHAR &&
- (m_carInObjective->m_status == STATUS_PLAYER_DISABLED || CPad::GetPad(CWorld::PlayerInFocus)->ArePlayerControlsDisabled())) {
+ (m_carInObjective->GetStatus() == STATUS_PLAYER_DISABLED || CPad::GetPad(CWorld::PlayerInFocus)->ArePlayerControlsDisabled())) {
SetObjectiveTimer(14000);
} else {
m_objectiveTimer = 0;
@@ -3166,13 +3166,13 @@ CPed::ReactToAttack(CEntity *attacker)
&& (m_pMyVehicle->pDriver == this || m_pMyVehicle->pDriver && m_pMyVehicle->pDriver->m_nPedState == PED_DRIVING)) {
if (m_pMyVehicle->VehicleCreatedBy == RANDOM_VEHICLE
- && (m_pMyVehicle->m_status == STATUS_SIMPLE || m_pMyVehicle->m_status == STATUS_PHYSICS)
+ && (m_pMyVehicle->GetStatus() == STATUS_SIMPLE || m_pMyVehicle->GetStatus() == STATUS_PHYSICS)
&& m_pMyVehicle->AutoPilot.m_nCarMission == MISSION_CRUISE) {
CCarCtrl::SwitchVehicleToRealPhysics(m_pMyVehicle);
m_pMyVehicle->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fUnkMaxVelocity;
- m_pMyVehicle->m_status = STATUS_PHYSICS;
+ m_pMyVehicle->SetStatus(STATUS_PHYSICS);
}
} else
#endif
@@ -3222,7 +3222,7 @@ CPed::TurnBody(void)
bool turnDone = true;
if (m_pLookTarget) {
- CVector &lookPos = m_pLookTarget->GetPosition();
+ const CVector &lookPos = m_pLookTarget->GetPosition();
lookDir = CGeneral::GetRadianAngleBetweenPoints(
lookPos.x,
@@ -3287,7 +3287,7 @@ CPed::Chat(void)
} else
Say(SOUND_PED_CHAT);
- } else if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG100)) {
+ } else if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG_XPRESS)) {
if (CGeneral::GetRandomNumber() < 20) {
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_XPRESS_SCRATCH, 4.0f);
@@ -3743,7 +3743,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
bool detectDieAnim = true;
if (m_nPedState == PED_FALL || m_nPedState == PED_GETUP) {
if (!IsPedHeadAbovePos(-0.3f)) {
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
dieAnim = ANIM_FLOOR_HIT_F;
else
dieAnim = ANIM_FLOOR_HIT;
@@ -3765,7 +3765,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
if (IsPedHeadAbovePos(-0.3f)) {
dieAnim = NUM_ANIMS;
} else {
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
dieAnim = ANIM_FLOOR_HIT_F;
else
dieAnim = ANIM_FLOOR_HIT;
@@ -3805,7 +3805,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
if (IsPedHeadAbovePos(-0.3f)) {
dieAnim = NUM_ANIMS;
} else {
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
dieAnim = ANIM_FLOOR_HIT_F;
else
dieAnim = ANIM_FLOOR_HIT;
@@ -3848,7 +3848,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
if (IsPedHeadAbovePos(-0.3f)) {
dieAnim = NUM_ANIMS;
} else {
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
dieAnim = ANIM_FLOOR_HIT_F;
else
dieAnim = ANIM_FLOOR_HIT;
@@ -4136,8 +4136,8 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
#ifdef VC_PED_PORTS
if (m_pMyVehicle) {
if (m_pMyVehicle->IsCar() && m_pMyVehicle->pDriver == this) {
- if (m_pMyVehicle->m_status == STATUS_SIMPLE) {
- m_pMyVehicle->m_status = STATUS_PHYSICS;
+ if (m_pMyVehicle->GetStatus() == STATUS_SIMPLE) {
+ m_pMyVehicle->SetStatus(STATUS_PHYSICS);
CCarCtrl::SwitchVehicleToRealPhysics(m_pMyVehicle);
}
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
@@ -4151,7 +4151,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
m_fHealth = 0.0f;
if (m_pMyVehicle && m_pMyVehicle->pDriver == this) {
SetRadioStation();
- m_pMyVehicle->m_status = STATUS_ABANDONED;
+ m_pMyVehicle->SetStatus(STATUS_ABANDONED);
}
SetDie(dieAnim, dieDelta, dieSpeed);
/*
@@ -4183,7 +4183,7 @@ CPed::InflictDamage(CEntity *damagedBy, eWeaponType method, float damage, ePedPi
}
m_fHealth = 0.0f;
if (player == this)
- m_pMyVehicle->m_status = STATUS_PLAYER_DISABLED;
+ m_pMyVehicle->SetStatus(STATUS_PLAYER_DISABLED);
SetDie(NUM_ANIMS, 4.0f, 0.0f);
return true;
@@ -4245,9 +4245,8 @@ CPed::SetGetUp(void)
CVehicle *veh = (CVehicle*)CPedPlacement::IsPositionClearOfCars(&GetPosition());
if (veh && veh->m_vehType != VEHICLE_TYPE_BIKE ||
collidingVeh && collidingVeh->IsVehicle() && collidingVeh->m_vehType != VEHICLE_TYPE_BIKE
- && ((uint8)(CTimer::GetFrameCounter() + m_randomSeed + 5) % 8
- || CCollision::ProcessColModels(GetMatrix(), *CModelInfo::GetModelInfo(m_modelIndex)->GetColModel(),
- collidingVeh->GetMatrix(), *CModelInfo::GetModelInfo(collidingVeh->m_modelIndex)->GetColModel(),
+ && ((uint8)(CTimer::GetFrameCounter() + m_randomSeed + 5) % 8 ||
+ CCollision::ProcessColModels(GetMatrix(), *GetColModel(), collidingVeh->GetMatrix(), *collidingVeh->GetColModel(),
aTempPedColPts, nil, nil) > 0)) {
bGetUpAnimStarted = false;
@@ -4274,7 +4273,7 @@ CPed::SetGetUp(void)
animAssoc->flags |= ASSOC_DELETEFADEDOUT;
}
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800))
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL))
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP_FRONT, 1000.0f);
else
animAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_GETUP1, 1000.0f);
@@ -4504,7 +4503,7 @@ CPed::RestorePreviousState(void)
bIsRunning = false;
if (!bFindNewNodeAfterStateRestore) {
if (m_pNextPathNode) {
- CVector diff = m_pNextPathNode->pos - GetPosition();
+ CVector diff = m_pNextPathNode->GetPosition() - GetPosition();
if (diff.MagnitudeSqr() < sq(7.0f)) {
SetMoveState(PEDMOVE_WALK);
break;
@@ -4640,9 +4639,9 @@ CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
animType = 1;
}
}
- if (neededTurn <= DEGTORAD(90.0f) || veh->m_modelIndex == MI_RCBANDIT || vehPressedHorn || animType != 0) {
+ if (neededTurn <= DEGTORAD(90.0f) || veh->GetModelIndex() == MI_RCBANDIT || vehPressedHorn || animType != 0) {
SetLookFlag(veh, true);
- if ((CGeneral::GetRandomNumber() & 1) && veh->m_modelIndex != MI_RCBANDIT && animType == 0) {
+ if ((CGeneral::GetRandomNumber() & 1) && veh->GetModelIndex() != MI_RCBANDIT && animType == 0) {
stepAnim = ANIM_IDLE_TAXI;
} else {
@@ -5149,7 +5148,7 @@ CPed::FightStrike(CVector &touchedNodePos)
#ifdef PED_SKIN
// Have to animate a skinned clump because the initial col model is useless
if(IsClumpSkinned(GetClump()))
- ourCol = ((CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex))->AnimatePedColModelSkinned(GetClump());
+ ourCol = ((CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()))->AnimatePedColModelSkinned(GetClump());
else
#endif
if (nearPed->m_nPedState == PED_FALL
@@ -5158,7 +5157,8 @@ CPed::FightStrike(CVector &touchedNodePos)
ourCol = &CTempColModels::ms_colModelPedGroundHit;
} else {
#ifdef ANIMATE_PED_COL_MODEL
- ourCol = CPedModelInfo::AnimatePedColModel(((CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex))->GetHitColModel(), RpClumpGetFrame(GetClump()));
+ ourCol = CPedModelInfo::AnimatePedColModel(((CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex()))->GetHitColModel(),
+ RpClumpGetFrame(GetClump()));
#else
ourCol = ((CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex))->GetHitColModel();
#endif
@@ -5916,7 +5916,7 @@ CPed::CreateDeadPedMoney(void)
if (!CGame::nastyGame)
return;
- int skin = m_modelIndex;
+ int skin = GetModelIndex();
if ((skin >= MI_COP && skin <= MI_FIREMAN) || CharCreatedBy == MISSION_CHAR || bInVehicle)
return;
@@ -6013,9 +6013,9 @@ CPed::SetBeingDraggedFromCar(CVehicle *veh, uint32 vehEnterType, bool quickJack)
m_vehEnterType = vehEnterType;
if (m_vehEnterType == CAR_DOOR_LF) {
if (veh->pDriver && veh->pDriver->IsPlayer())
- veh->m_status = STATUS_PLAYER_DISABLED;
+ veh->SetStatus(STATUS_PLAYER_DISABLED);
else
- veh->m_status = STATUS_ABANDONED;
+ veh->SetStatus(STATUS_ABANDONED);
}
RemoveInCarAnims();
SetMoveState(PEDMOVE_NONE);
@@ -6397,7 +6397,7 @@ uint8
CPed::GetNearestTrainPedPosition(CVehicle *train, CVector &enterPos)
{
CVector enterStepOffset;
- CVehicleModelInfo *trainModel = (CVehicleModelInfo*) CModelInfo::GetModelInfo(train->m_modelIndex);
+ CVehicleModelInfo *trainModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(train->GetModelIndex());
CMatrix trainMat = CMatrix(train->GetMatrix());
CVector leftEntryPos, rightEntryPos, midEntryPos;
float distLeftEntry, distRightEntry, distMidEntry;
@@ -6472,7 +6472,7 @@ void
CPed::LineUpPedWithTrain(void)
{
CVector lineUpPos;
- CVehicleModelInfo *trainModel = (CVehicleModelInfo*)CModelInfo::GetModelInfo(m_pMyVehicle->m_modelIndex);
+ CVehicleModelInfo *trainModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(m_pMyVehicle->GetModelIndex());
CVector enterOffset(1.5f, 0.0f, -0.2f);
m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
@@ -6504,7 +6504,7 @@ CPed::LineUpPedWithTrain(void)
lineUpPos += (GetPosition() - lineUpPos) * percentageLeft;
}
- GetPosition() = lineUpPos;
+ SetPosition(lineUpPos);
SetHeading(m_fRotationCur);
}
@@ -6535,7 +6535,7 @@ CPed::ExitCar(void)
// Car is upside down
if (m_pMyVehicle->GetUp().z > -0.8f) {
if (exitAnim != ANIM_CAR_CLOSE_RHS && exitAnim != ANIM_CAR_CLOSE_LHS && animTime <= 0.3f)
- LineUpPedWithCar((m_pMyVehicle->m_modelIndex == MI_DODO ? LINE_UP_TO_CAR_END : LINE_UP_TO_CAR_START));
+ LineUpPedWithCar((m_pMyVehicle->GetModelIndex() == MI_DODO ? LINE_UP_TO_CAR_END : LINE_UP_TO_CAR_START));
else
LineUpPedWithCar(LINE_UP_TO_CAR_END);
} else {
@@ -6925,10 +6925,10 @@ SelectClosestNodeForSeek(CPed *ped, CPathNode *node, CVector2D closeDist, CVecto
{
for (int i = 0; i < node->numLinks; i++) {
- CPathNode *testNode = &ThePaths.m_pathNodes[ThePaths.m_connections[i + node->firstLink]];
+ CPathNode *testNode = &ThePaths.m_pathNodes[ThePaths.ConnectedNode(i + node->firstLink)];
if (testNode && testNode != closeNode && testNode != closeNode2) {
- CVector2D posDiff(ped->m_vecSeekPos - testNode->pos);
+ CVector2D posDiff(ped->m_vecSeekPos - testNode->GetPosition());
float dist = posDiff.MagnitudeSqr();
if (farDist.MagnitudeSqr() > dist) {
@@ -6969,16 +6969,16 @@ CPed::FindBestCoordsFromNodes(CVector unused, CVector *bestCoords)
CVector2D seekPosDist (m_vecSeekPos - ourPos);
CPathNode *closestNode = &ThePaths.m_pathNodes[closestNodeId];
- CVector2D closeDist(m_vecSeekPos - closestNode->pos);
+ CVector2D closeDist(m_vecSeekPos - closestNode->GetPosition());
SelectClosestNodeForSeek(this, closestNode, closeDist, seekPosDist, closestNode, nil);
// Above function decided that going to the next node is more logical than seeking the object.
if (m_pNextPathNode) {
- CVector pathToNextNode = m_pNextPathNode->pos - ourPos;
+ CVector pathToNextNode = m_pNextPathNode->GetPosition() - ourPos;
if (pathToNextNode.MagnitudeSqr2D() < seekPosDist.MagnitudeSqr()) {
- *bestCoords = m_pNextPathNode->pos;
+ *bestCoords = m_pNextPathNode->GetPosition();
return true;
}
m_pNextPathNode = nil;
@@ -7043,7 +7043,7 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg)
return;
CVector forward(0.15f * ped->GetForward() + ped->GetPosition());
- forward.z += CModelInfo::GetModelInfo(ped->m_modelIndex)->GetColModel()->spheres->center.z + 0.25f;
+ forward.z += CModelInfo::GetModelInfo(ped->GetModelIndex())->GetColModel()->spheres->center.z + 0.25f;
CEntity *obstacle = CWorld::TestSphereAgainstWorld(forward, 0.25f, nil, true, true, false, true, false, false);
if (!obstacle) {
@@ -7483,7 +7483,7 @@ CPed::Seek(void)
if (!obstacle->IsVehicle() || ((CVehicle*)obstacle)->m_vehType == VEHICLE_TYPE_CAR) {
distanceToCountItDone = 2.5f;
} else {
- CVehicleModelInfo *vehModel = (CVehicleModelInfo*) CModelInfo::GetModelInfo(obstacle->m_modelIndex);
+ CVehicleModelInfo *vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(obstacle->GetModelIndex());
float yLength = vehModel->GetColModel()->boundingBox.max.y
- vehModel->GetColModel()->boundingBox.min.y;
distanceToCountItDone = yLength * 0.55f;
@@ -7671,7 +7671,7 @@ CPed::Flee(void)
}
if (m_pNextPathNode) {
- m_vecSeekPos = m_pNextPathNode->pos;
+ m_vecSeekPos = m_pNextPathNode->GetPosition();
if (m_nMoveState == PEDMOVE_RUN)
bIsRunning = true;
@@ -7940,9 +7940,9 @@ CPed::GetNearestPassengerDoor(CVehicle *veh, CVector &posToOpen)
CVector rfPos, lrPos, rrPos;
bool canEnter = false;
- CVehicleModelInfo *vehModel = (CVehicleModelInfo*)CModelInfo::GetModelInfo(veh->m_modelIndex);
+ CVehicleModelInfo *vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(veh->GetModelIndex());
- switch (veh->m_modelIndex) {
+ switch (veh->GetModelIndex()) {
case MI_BUS:
m_vehEnterType = CAR_DOOR_RF;
posToOpen = GetPositionToOpenCarDoor(veh, CAR_DOOR_RF);
@@ -8584,7 +8584,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
eWeaponType killMethod;
if (m_nPedState == PED_FALL || m_nPedState == PED_DIE) {
- if (!this->m_pCollidingEntity || car->m_status == STATUS_PLAYER)
+ if (!this->m_pCollidingEntity || car->GetStatus() == STATUS_PLAYER)
this->m_pCollidingEntity = car;
return;
}
@@ -8599,7 +8599,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
CVector distVec = GetPosition() - car->GetPosition();
- if ((impulse > 12.0f || car->m_modelIndex == MI_TRAIN) && !IsPlayer()) {
+ if ((impulse > 12.0f || car->GetModelIndex() == MI_TRAIN) && !IsPlayer()) {
nodeToDamage = PED_TORSO;
killMethod = WEAPONTYPE_RAMMEDBYCAR;
uint8 randVal = CGeneral::GetRandomNumber() & 3;
@@ -8616,11 +8616,11 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
}
bIsStanding = false;
damageDir = CPed::GetLocalDirection(-m_vecMoveSpeed);
- vehModel = (CVehicleModelInfo*)CModelInfo::GetModelInfo(car->m_modelIndex);
+ vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(car->GetModelIndex());
vehColModel = vehModel->GetColModel();
float carRightAndDistDotProd = DotProduct(distVec, car->GetRight());
- if (car->m_modelIndex == MI_TRAIN) {
+ if (car->GetModelIndex() == MI_TRAIN) {
killMethod = WEAPONTYPE_RUNOVERBYCAR;
nodeToDamage = PED_HEAD;
m_vecMoveSpeed = 0.9f * car->m_vecMoveSpeed;
@@ -8684,7 +8684,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
carHighestZ = (car->GetMatrix() * CVector(0.0f, vehColMaxY, vehColMaxZ)).z;
float highestZDist = carHighestZ - GetPosition().z;
if (highestZDist > 0.0f) {
- GetPosition().z += 0.5f * highestZDist;
+ GetMatrix().GetPosition().z += 0.5f * highestZDist;
carHighestZ += highestZDist * 0.25f;
}
carLength = vehColMaxY;
@@ -8780,7 +8780,7 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
bIsStanding = false;
uint8 fallDirection = GetLocalDirection(-car->m_vecMoveSpeed);
float damage;
- if (IsPlayer() && car->m_modelIndex == MI_TRAIN)
+ if (IsPlayer() && car->GetModelIndex() == MI_TRAIN)
damage = 150.0f;
else
damage = 30.0f;
@@ -8789,14 +8789,14 @@ CPed::KillPedWithCar(CVehicle *car, float impulse)
CPed::SetFall(1000, (AnimationId)(fallDirection + ANIM_KO_SKID_FRONT), true);
if ((m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD)
- && !m_pCollidingEntity
- && (!IsPlayer() || bHasHitWall || car->m_modelIndex == MI_TRAIN || m_vecDamageNormal.z < -0.8f)) {
+ && !m_pCollidingEntity &&
+ (!IsPlayer() || bHasHitWall || car->GetModelIndex() == MI_TRAIN || m_vecDamageNormal.z < -0.8f)) {
m_pCollidingEntity = car;
}
bKnockedUpIntoAir = false;
- if (car->m_modelIndex != MI_TRAIN && !bHasHitWall) {
+ if (car->GetModelIndex() != MI_TRAIN && !bHasHitWall) {
m_vecMoveSpeed = car->m_vecMoveSpeed * 0.75f;
}
m_vecMoveSpeed.z = 0.0f;
@@ -8870,8 +8870,8 @@ CPed::LookForInterestingNodes(void)
for (ptrNode = sector->m_lists[ENTITYLIST_VEHICLES].first; ptrNode && !found; ptrNode = ptrNode->next) {
CVehicle *veh = (CVehicle*)ptrNode->item;
model = veh->GetModelInfo();
- if (model->m_num2dEffects != 0) {
- for (int e = 0; e < model->m_num2dEffects; e++) {
+ if (model->GetNum2dEffects() != 0) {
+ for (int e = 0; e < model->GetNum2dEffects(); e++) {
effect = model->Get2dEffect(e);
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
objMat = &veh->GetMatrix();
@@ -8887,9 +8887,9 @@ CPed::LookForInterestingNodes(void)
}
for (ptrNode = sector->m_lists[ENTITYLIST_OBJECTS].first; ptrNode && !found; ptrNode = ptrNode->next) {
CObject *obj = (CObject*)ptrNode->item;
- model = CModelInfo::GetModelInfo(obj->m_modelIndex);
- if (model->m_num2dEffects != 0) {
- for (int e = 0; e < model->m_num2dEffects; e++) {
+ model = CModelInfo::GetModelInfo(obj->GetModelIndex());
+ if (model->GetNum2dEffects() != 0) {
+ for (int e = 0; e < model->GetNum2dEffects(); e++) {
effect = model->Get2dEffect(e);
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
objMat = &obj->GetMatrix();
@@ -8905,9 +8905,9 @@ CPed::LookForInterestingNodes(void)
}
for (ptrNode = sector->m_lists[ENTITYLIST_BUILDINGS].first; ptrNode && !found; ptrNode = ptrNode->next) {
CBuilding *building = (CBuilding*)ptrNode->item;
- model = CModelInfo::GetModelInfo(building->m_modelIndex);
- if (model->m_num2dEffects != 0) {
- for (int e = 0; e < model->m_num2dEffects; e++) {
+ model = CModelInfo::GetModelInfo(building->GetModelIndex());
+ if (model->GetNum2dEffects() != 0) {
+ for (int e = 0; e < model->GetNum2dEffects(); e++) {
effect = model->Get2dEffect(e);
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
objMat = &building->GetMatrix();
@@ -8923,9 +8923,9 @@ CPed::LookForInterestingNodes(void)
}
for (ptrNode = sector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].first; ptrNode && !found; ptrNode = ptrNode->next) {
CBuilding *building = (CBuilding*)ptrNode->item;
- model = CModelInfo::GetModelInfo(building->m_modelIndex);
- if (model->m_num2dEffects != 0) {
- for (int e = 0; e < model->m_num2dEffects; e++) {
+ model = CModelInfo::GetModelInfo(building->GetModelIndex());
+ if (model->GetNum2dEffects() != 0) {
+ for (int e = 0; e < model->GetNum2dEffects(); e++) {
effect = model->Get2dEffect(e);
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
objMat = &building->GetMatrix();
@@ -9153,7 +9153,7 @@ CPed::MoveHeadToLook(void)
if (animTime > 4.0f / 30.0f && animTime - fuckUAssoc->timeStep > 4.0f / 30.0f) {
bool lookingToCop = false;
- if (m_pLookTarget->m_modelIndex == MI_POLICE
+ if (m_pLookTarget->GetModelIndex() == MI_POLICE
|| m_pLookTarget->IsPed() && ((CPed*)m_pLookTarget)->m_nPedType == PEDTYPE_COP) {
lookingToCop = true;
@@ -9213,7 +9213,7 @@ CPed::MoveHeadToLook(void)
} else {
animToPlay = ANIM_FUCKU;
}
- } else if (m_pedStats->m_temper > 49 || m_pLookTarget->m_modelIndex == MI_POLICE) {
+ } else if (m_pedStats->m_temper > 49 || m_pLookTarget->GetModelIndex() == MI_POLICE) {
animToPlay = ANIM_FUCKU;
}
} else if (notRocketLauncher && (CGeneral::GetRandomNumber() & 1)) {
@@ -9487,14 +9487,14 @@ CPed::ProcessControl(void)
#ifdef VC_PED_PORTS
if (bIsInWater) {
bIsStanding = false;
- m_ped_flagA2 = false;
+ bWasStanding = false;
CPhysical::ProcessControl();
}
#endif
return;
}
- m_ped_flagA2 = false;
+ bWasStanding = false;
if (bIsStanding) {
if (!CWorld::bForceProcessControl) {
if (m_pCurrentPhysSurface && m_pCurrentPhysSurface->bIsInSafePosition) {
@@ -9544,14 +9544,14 @@ CPed::ProcessControl(void)
#else
} else if (collidingEnt) {
#endif
- switch (collidingEnt->m_type)
+ switch (collidingEnt->GetType())
{
case ENTITY_TYPE_BUILDING:
case ENTITY_TYPE_OBJECT:
{
- CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->m_modelIndex);
+ CBaseModelInfo *collidingModel = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex());
CColModel *collidingCol = collidingModel->GetColModel();
- if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_CHANGE_THEN_SMASH
+ if (collidingEnt->IsObject() && ((CObject*)collidingEnt)->m_nSpecialCollisionResponseCases != COLLRESPONSE_FENCEPART
|| collidingCol->boundingBox.max.x < 3.0f
&& collidingCol->boundingBox.max.y < 3.0f) {
@@ -9653,17 +9653,17 @@ CPed::ProcessControl(void)
if (m_nPedState == PED_WANDER_PATH) {
m_pNextPathNode = &ThePaths.m_pathNodes[closestNodeId];
angleToFace = CGeneral::GetRadianAngleBetweenPoints(
- m_pNextPathNode->pos.x, m_pNextPathNode->pos.y,
+ m_pNextPathNode->GetX(), m_pNextPathNode->GetY(),
GetPosition().x, GetPosition().y);
} else {
- if (ThePaths.m_pathNodes[closestNodeId].pos.x == 0.0f
- || ThePaths.m_pathNodes[closestNodeId].pos.y == 0.0f) {
+ if (ThePaths.m_pathNodes[closestNodeId].GetX() == 0.0f
+ || ThePaths.m_pathNodes[closestNodeId].GetY() == 0.0f) {
posToHead = (3.0f * m_vecDamageNormal) + GetPosition();
posToHead.x += (CGeneral::GetRandomNumber() % 512) / 250.0f - 1.0f;
posToHead.y += (CGeneral::GetRandomNumber() % 512) / 250.0f - 1.0f;
} else {
- posToHead.x = ThePaths.m_pathNodes[closestNodeId].pos.x;
- posToHead.y = ThePaths.m_pathNodes[closestNodeId].pos.y;
+ posToHead.x = ThePaths.m_pathNodes[closestNodeId].GetX();
+ posToHead.y = ThePaths.m_pathNodes[closestNodeId].GetY();
}
angleToFace = CGeneral::GetRadianAngleBetweenPoints(
posToHead.x, posToHead.y,
@@ -9674,12 +9674,12 @@ CPed::ProcessControl(void)
}
} else {
angleToFace = CGeneral::GetRadianAngleBetweenPoints(
- ThePaths.m_pathNodes[closestNodeId].pos.x,
- ThePaths.m_pathNodes[closestNodeId].pos.y,
+ ThePaths.m_pathNodes[closestNodeId].GetX(),
+ ThePaths.m_pathNodes[closestNodeId].GetY(),
GetPosition().x,
GetPosition().y);
- CVector2D distToNode = ThePaths.m_pathNodes[closestNodeId].pos - GetPosition();
+ CVector2D distToNode = ThePaths.m_pathNodes[closestNodeId].GetPosition() - GetPosition();
CVector2D distToSeekPos = m_vecSeekPos - GetPosition();
if (DotProduct2D(distToNode, distToSeekPos) < 0.0f) {
@@ -9773,7 +9773,7 @@ CPed::ProcessControl(void)
if (collidingVeh != m_pCurrentPhysSurface || IsPlayer()) {
if (!bVehEnterDoorIsBlocked) {
- if (collidingVeh->m_status != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) {
+ if (collidingVeh->GetStatus() != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) {
// VC calls SetDirectionToWalkAroundVehicle instead if ped is in PED_SEEK_CAR.
SetDirectionToWalkAroundObject(collidingVeh);
@@ -9959,7 +9959,7 @@ CPed::ProcessControl(void)
}
} else if (!bVehEnterDoorIsBlocked) {
- if (collidingVeh->m_status != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) {
+ if (collidingVeh->GetStatus() != STATUS_PLAYER || CharCreatedBy == MISSION_CHAR) {
SetDirectionToWalkAroundObject(collidingVeh);
@@ -9978,7 +9978,7 @@ CPed::ProcessControl(void)
} else {
DMAudio.PlayOneShot(collidingVeh->m_audioEntityId, SOUND_CAR_PED_COLLISION, m_fDamageImpulse);
if (IsPlayer()) {
- CColModel *collidingCol = CModelInfo::GetModelInfo(collidingVeh->m_modelIndex)->GetColModel();
+ CColModel *collidingCol = CModelInfo::GetModelInfo(collidingVeh->GetModelIndex())->GetColModel();
CVector colMinVec = collidingCol->boundingBox.min;
CVector colMaxVec = collidingCol->boundingBox.max;
@@ -10040,7 +10040,7 @@ CPed::ProcessControl(void)
float damage;
if (driver && driver->IsPlayer()) {
damage = vehRightVecAndSpeedDotProd * 1000.0f;
- } else if (collidingVeh->m_modelIndex == MI_TRAIN) {
+ } else if (collidingVeh->GetModelIndex() == MI_TRAIN) {
damage = 50.0f;
} else {
damage = 20.0f;
@@ -10106,7 +10106,7 @@ CPed::ProcessControl(void)
}
if ((bIsInTheAir && !DyingOrDead())
#ifdef VC_PED_PORTS
- || (!bIsStanding && !m_ped_flagA2 && m_nPedState == PED_FALL)
+ || (!bIsStanding && !bWasStanding && m_nPedState == PED_FALL)
#endif
) {
if (m_nPedStateTimer <= 1000 && m_nPedStateTimer) {
@@ -10126,7 +10126,7 @@ CPed::ProcessControl(void)
if ((m_nPedStateTimer <= 50.0f / (4.0f * adjustedTs) || m_nPedStateTimer * 0.01f <= forceDir.MagnitudeSqr())
&& (m_nCollisionRecords <= 1 || m_nPedStateTimer <= 50.0f / (2.0f * adjustedTs) || m_nPedStateTimer * 1.0f / 250.0f <= Abs(forceDir.z))) {
- if (m_nCollisionRecords == 1 && m_aCollisionRecords[0] != nil && m_aCollisionRecords[0]->m_type == ENTITY_TYPE_BUILDING
+ if (m_nCollisionRecords == 1 && m_aCollisionRecords[0] != nil && m_aCollisionRecords[0]->IsBuilding()
&& m_nPedStateTimer > 50.0f / (2.0f * adjustedTs) && m_nPedStateTimer * 1.0f / 250.0f > Abs(forceDir.z)) {
offsetToCheck.x = -forceDir.y;
#ifdef VC_PED_PORTS
@@ -10169,8 +10169,8 @@ CPed::ProcessControl(void)
}
if (flyDir != 0 && !bSomeVCflag1) {
- GetPosition() = (flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point);
- GetPosition().z += FEET_OFFSET;
+ SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point));
+ GetMatrix().GetPosition().z += FEET_OFFSET;
GetMatrix().UpdateRW();
SetLanding();
bIsStanding = true;
@@ -10184,7 +10184,7 @@ CPed::ProcessControl(void)
forceDir.z = 4.0f;
ApplyMoveForce(forceDir);
- GetPosition() += 0.25f * offsetToCheck;
+ GetMatrix().GetPosition() += 0.25f * offsetToCheck;
m_fRotationCur = CGeneral::GetRadianAngleBetweenPoints(offsetToCheck.x, offsetToCheck.y, 0.0f, 0.0f);
m_fRotationCur = CGeneral::LimitRadianAngle(m_fRotationCur);
@@ -10276,13 +10276,13 @@ CPed::ProcessControl(void)
if (CWorld::ProcessVerticalLine(offsetToCheck, GetPosition().z - FEET_OFFSET, foundCol, foundEnt, true, true, false, true, false, false, nil)) {
#ifdef VC_PED_PORTS
if (!bSomeVCflag1 || FEET_OFFSET + foundCol.point.z < GetPosition().z) {
- GetPosition().z = FEET_OFFSET + foundCol.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z;
GetMatrix().UpdateRW();
if (bSomeVCflag1)
bSomeVCflag1 = false;
}
#else
- GetPosition().z = FEET_OFFSET + foundCol.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z;
GetMatrix().UpdateRW();
#endif
SetLanding();
@@ -10994,7 +10994,7 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
} else if (ped->m_nPedType == PEDTYPE_COP) {
ped->QuitEnteringCar();
if (ped->m_pedInObjective && ped->m_pedInObjective->m_nPedState == PED_DRIVING) {
- veh->m_status = STATUS_PLAYER_DISABLED;
+ veh->SetStatus(STATUS_PLAYER_DISABLED);
((CCopPed*)ped)->SetArrestPlayer(ped->m_pedInObjective);
} else if (!veh->IsDoorMissing(DOOR_FRONT_RIGHT)) {
((CAutomobile*)veh)->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, DOOR_STATUS_SWINGING);
@@ -11145,7 +11145,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
veh->m_nNumGettingIn = 0;
veh->m_nGettingInFlags = 0;
veh->bIsHandbrakeOn = true;
- veh->m_status = STATUS_PLAYER_DISABLED;
+ veh->SetStatus(STATUS_PLAYER_DISABLED);
}
return;
}
@@ -11190,7 +11190,7 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg)
driver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh);
if (driver->IsPlayer()) {
veh->bIsHandbrakeOn = true;
- veh->m_status = STATUS_PLAYER_DISABLED;
+ veh->SetStatus(STATUS_PLAYER_DISABLED);
}
driver->bBusJacked = true;
veh->bIsBeingCarJacked = false;
@@ -11562,7 +11562,7 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg)
#endif
CPedPlacement::FindZCoorForPed(&posAfterBeingDragged);
ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
- ped->GetPosition() = posAfterBeingDragged;
+ ped->SetPosition(posAfterBeingDragged);
if (ped->m_pMyVehicle && !ped->m_pMyVehicle->IsRoomForPedToLeaveCar(ped->m_vehEnterType, &vecPedDraggedOutCarAnimOffset)) {
ped->PositionPedOutOfCollision();
@@ -11704,11 +11704,11 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
#if defined(FIX_BUGS) || defined(VC_PED_PORTS)
CCarCtrl::RegisterVehicleOfInterest(veh);
#endif
- if (veh->m_status == STATUS_SIMPLE) {
+ if (veh->GetStatus() == STATUS_SIMPLE) {
veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.00001f);
veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
}
- veh->m_status = STATUS_PLAYER;
+ veh->SetStatus(STATUS_PLAYER);
AudioManager.PlayerJustGotInCar();
}
veh->SetDriver(ped);
@@ -11729,19 +11729,19 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
if (ped->IsPlayer()) {
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) {
- if (veh->m_status == STATUS_SIMPLE) {
+ if (veh->GetStatus() == STATUS_SIMPLE) {
veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
}
- veh->m_status = STATUS_PLAYER;
+ veh->SetStatus(STATUS_PLAYER);
}
AudioManager.PlayerJustGotInCar();
} else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) {
- if (veh->m_status == STATUS_SIMPLE) {
+ if (veh->GetStatus() == STATUS_SIMPLE) {
veh->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
veh->m_vecTurnSpeed = CVector(0.0f, 0.0f, 0.0f);
}
- veh->m_status = STATUS_PHYSICS;
+ veh->SetStatus(STATUS_PHYSICS);
}
if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) {
@@ -11979,7 +11979,7 @@ CPed::RegisterThreatWithGangPeds(CEntity *attacker)
}
if (attackerPed && attackerPed->IsPlayer() && (attackerPed->m_nPedState == PED_CARJACK || attackerPed->bInVehicle)) {
- if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->m_modelIndex != MI_TOYZ) {
+ if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->GetModelIndex() != MI_TOYZ) {
int16 lastVehicle;
CEntity *vehicles[8];
CWorld::FindObjectsInRange(GetPosition(), 30.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
@@ -11998,7 +11998,7 @@ CPed::RegisterThreatWithGangPeds(CEntity *attacker)
if (nearVeh->IsVehicleNormal() && nearVeh->IsCar()) {
nearVeh->AutoPilot.m_nCruiseSpeed = GAME_SPEED_TO_CARAI_SPEED * nearVeh->pHandling->Transmission.fUnkMaxVelocity * 0.8f;
nearVeh->AutoPilot.m_nCarMission = MISSION_RAMPLAYER_FARAWAY;
- nearVeh->m_status = STATUS_PHYSICS;
+ nearVeh->SetStatus(STATUS_PHYSICS);
nearVeh->AutoPilot.m_nTempAction = TEMPACT_NONE;
nearVeh->AutoPilot.m_nDrivingStyle = DRIVINGSTYLE_AVOID_CARS;
}
@@ -12187,7 +12187,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
CVector posFromZ = ped->GetPosition();
CPedPlacement::FindZCoorForPed(&posFromZ);
ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
- ped->GetPosition() = posFromZ;
+ ped->SetPosition(posFromZ);
veh = ped->m_pMyVehicle;
if (veh) {
if (ped->m_nPedType == PEDTYPE_PROSTITUTE) {
@@ -12205,7 +12205,7 @@ CPed::PedSetOutCarCB(CAnimBlendAssociation *animAssoc, void *arg)
veh->m_nGettingOutFlags &= ~GetCarDoorFlag(ped->m_vehEnterType);
if (veh->pDriver == ped) {
veh->RemoveDriver();
- veh->m_status = STATUS_ABANDONED;
+ veh->SetStatus(STATUS_ABANDONED);
if (veh->m_nDoorLock == CARLOCK_LOCKED_INITIALLY)
veh->m_nDoorLock = CARLOCK_UNLOCKED;
if (ped->m_nPedType == PEDTYPE_COP && veh->IsLawEnforcementVehicle())
@@ -12310,7 +12310,7 @@ CPed::PedSetOutTrainCB(CAnimBlendAssociation *animAssoc, void *arg)
posAfterExit += ped->GetPosition();
CPedPlacement::FindZCoorForPed(&posAfterExit);
ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
- ped->GetPosition() = posAfterExit;
+ ped->SetPosition(posAfterExit);
ped->SetHeading(ped->m_fRotationCur);
veh->RemovePassenger(ped);
}
@@ -12342,9 +12342,9 @@ CPed::PlacePedOnDryLand(void)
foundColZ = foundCol.point.z;
if (foundColZ >= waterLevel) {
posToCheck.z = 0.8f + foundColZ;
- GetPosition() = posToCheck;
+ SetPosition(posToCheck);
bIsStanding = true;
- m_ped_flagA2 = true;
+ bWasStanding = true;
return true;
}
}
@@ -12360,9 +12360,9 @@ CPed::PlacePedOnDryLand(void)
return false;
posToCheck.z = 0.8f + foundColZ;
- GetPosition() = posToCheck;
+ SetPosition(posToCheck);
bIsStanding = true;
- m_ped_flagA2 = true;
+ bWasStanding = true;
return true;
}
@@ -12388,7 +12388,7 @@ CPed::PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *animAssoc, void
finalPos = finalLocalPos + ped->GetPosition();
CPedPlacement::FindZCoorForPed(&finalPos);
ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
- ped->GetPosition() = finalPos;
+ ped->SetPosition(finalPos);
if (veh) {
ped->m_fRotationDest = veh->GetForward().Heading() - HALFPI;
@@ -12524,11 +12524,11 @@ CPed::PositionPedOutOfCollision(void)
// We refrain from using posNearVeh, probably because of it may be top of the vehicle.
if (putSomewhereClose) {
- GetPosition() = posSomewhereClose;
+ SetPosition(posSomewhereClose);
} else {
CVector vehSize = veh->GetModelInfo()->GetColModel()->boundingBox.max;
- GetPosition() = posNearVeh;
- GetPosition().z += vehSize.z;
+ posNearVeh.z += vehSize.z;
+ SetPosition(posNearVeh);
}
return true;
}
@@ -12706,7 +12706,7 @@ CPed::renderLimb(int node)
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(GetClump());
int idx = RpHAnimIDGetIndex(hier, m_pFrames[node]->nodeID);
RwMatrix *mat = &RpHAnimHierarchyGetMatrixArray(hier)[idx];
- CPedModelInfo *mi = (CPedModelInfo*)CModelInfo::GetModelInfo(m_modelIndex);
+ CPedModelInfo *mi = (CPedModelInfo *)CModelInfo::GetModelInfo(GetModelIndex());
RpAtomic *atomic;
switch(node){
case PED_HEAD:
@@ -12846,7 +12846,7 @@ CPed::ProcessObjective(void)
|| m_pMyVehicle->m_vecMoveSpeed.MagnitudeSqr() >= sq(0.02f)) {
if (m_pMyVehicle->pDriver == this
&& !m_pMyVehicle->m_nGettingInFlags) {
- m_pMyVehicle->m_status = STATUS_PHYSICS;
+ m_pMyVehicle->SetStatus(STATUS_PHYSICS);
m_pMyVehicle->AutoPilot.m_nPrevRouteNode = 0;
if (m_nPedType == PEDTYPE_COP) {
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = (FindPlayerPed()->m_pWanted->m_nWantedLevel * 0.1f + 0.6f) * (GAME_SPEED_TO_CARAI_SPEED * m_pMyVehicle->pHandling->Transmission.fUnkMaxVelocity);
@@ -12904,7 +12904,7 @@ CPed::ProcessObjective(void)
if (closestNode >= 0) {
int16 colliding;
CWorld::FindObjectsKindaColliding(
- ThePaths.m_pathNodes[closestNode].pos, 10.0f, true, &colliding, 2, nil, false, true, true, false, false);
+ ThePaths.m_pathNodes[closestNode].GetPosition(), 10.0f, true, &colliding, 2, nil, false, true, true, false, false);
if (!colliding) {
CZoneInfo zoneInfo;
int chosenCarClass;
@@ -12912,10 +12912,10 @@ CPed::ProcessObjective(void)
int chosenModel = CCarCtrl::ChooseModel(&zoneInfo, &ourPos, &chosenCarClass);
CAutomobile *newVeh = new CAutomobile(chosenModel, RANDOM_VEHICLE);
if (newVeh) {
- newVeh->GetPosition() = ThePaths.m_pathNodes[closestNode].pos;
- newVeh->GetPosition().z += 4.0f;
+ newVeh->GetMatrix().GetPosition() = ThePaths.m_pathNodes[closestNode].GetPosition();
+ newVeh->GetMatrix().GetPosition().z += 4.0f;
newVeh->SetHeading(DEGTORAD(200.0f));
- newVeh->m_status = STATUS_ABANDONED;
+ newVeh->SetStatus(STATUS_ABANDONED);
newVeh->m_nDoorLock = CARLOCK_UNLOCKED;
CWorld::Add(newVeh);
m_pMyVehicle = newVeh;
@@ -13017,7 +13017,7 @@ CPed::ProcessObjective(void)
float distWithTargetSc = distWithTarget.Magnitude();
if (m_pedInObjective->bInVehicle && m_pedInObjective->m_nPedState != PED_DRAG_FROM_CAR) {
CVehicle *vehOfTarget = m_pedInObjective->m_pMyVehicle;
- if (vehOfTarget->bIsInWater || vehOfTarget->m_status == STATUS_PLAYER_DISABLED
+ if (vehOfTarget->bIsInWater || vehOfTarget->GetStatus() == STATUS_PLAYER_DISABLED
|| m_pedInObjective->IsPlayer() && CPad::GetPad(0)->ArePlayerControlsDisabled()) {
SetIdle();
return;
@@ -13112,7 +13112,7 @@ CPed::ProcessObjective(void)
FindBestCoordsFromNodes(m_vecSeekPos, &bestCoords);
if (m_pNextPathNode)
- m_vecSeekPos = m_pNextPathNode->pos;
+ m_vecSeekPos = m_pNextPathNode->GetPosition();
SetSeek(m_vecSeekPos, m_distanceToCountSeekDone);
} else {
@@ -13424,7 +13424,7 @@ CPed::ProcessObjective(void)
}
}
if (foundSeat) {
- GetPosition() = GetPositionToOpenCarDoor(m_carInObjective, m_vehEnterType);
+ SetPosition(GetPositionToOpenCarDoor(m_carInObjective, m_vehEnterType));
SetEnterCar(m_carInObjective, m_vehEnterType);
}
}
@@ -13666,7 +13666,7 @@ CPed::ProcessObjective(void)
FindBestCoordsFromNodes(m_vecSeekPos, &bestCoords);
if (m_pNextPathNode)
- m_vecSeekPos = m_pNextPathNode->pos;
+ m_vecSeekPos = m_pNextPathNode->GetPosition();
}
SetSeek(m_vecSeekPos, m_distanceToCountSeekDone);
}
@@ -14033,7 +14033,7 @@ CPed::SetSeekBoatPosition(CVehicle *boat)
void
CPed::SetExitTrain(CVehicle* train)
{
- if (m_nPedState == PED_EXIT_TRAIN || train->m_status != STATUS_TRAIN_NOT_MOVING || !((CTrain*)train)->Doors[0].IsFullyOpen())
+ if (m_nPedState == PED_EXIT_TRAIN || train->GetStatus() != STATUS_TRAIN_NOT_MOVING || !((CTrain*)train)->Doors[0].IsFullyOpen())
return;
/*
@@ -14098,7 +14098,7 @@ void
CPed::SetDirectionToWalkAroundObject(CEntity *obj)
{
float distLimitForTimer = 8.0f;
- CColModel *objCol = CModelInfo::GetModelInfo(obj->m_modelIndex)->GetColModel();
+ CColModel *objCol = CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel();
CVector objColMin = objCol->boundingBox.min;
CVector objColMax = objCol->boundingBox.max;
CVector objColCenter = (objColMin + objColMax) / 2.0f;
@@ -14117,7 +14117,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
#ifdef TOGGLEABLE_BETA_FEATURES
if (!bMakePedsRunToPhonesToReportCrimes)
#endif
- if (CharCreatedBy != MISSION_CHAR && obj->m_modelIndex == MI_PHONEBOOTH1) {
+ if (CharCreatedBy != MISSION_CHAR && obj->GetModelIndex() == MI_PHONEBOOTH1) {
bool isRunning = m_nMoveState == PEDMOVE_RUN || m_nMoveState == PEDMOVE_SPRINT;
SetFindPathAndFlee(obj, 5000, !isRunning);
return;
@@ -14133,7 +14133,7 @@ CPed::SetDirectionToWalkAroundObject(CEntity *obj)
if (objMat.GetUp().z < 0.0f)
objUpsideDown = true;
- if (obj->m_modelIndex != MI_TRAFFICLIGHTS && obj->m_modelIndex != MI_SINGLESTREETLIGHTS1 && obj->m_modelIndex != MI_SINGLESTREETLIGHTS2) {
+ if (obj->GetModelIndex() != MI_TRAFFICLIGHTS && obj->GetModelIndex() != MI_SINGLESTREETLIGHTS1 && obj->GetModelIndex() != MI_SINGLESTREETLIGHTS2) {
objColCenter = obj->GetMatrix() * objColCenter;
} else {
checkIntervalInDist = 0.4f;
@@ -14650,8 +14650,8 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
CColPoint intersectionPoint;
CColLine ourLine;
- CColModel *ourCol = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel();
- CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->m_modelIndex)->GetColModel();
+ CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel();
+ CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel();
if (!bUsesCollision)
return false;
@@ -14660,7 +14660,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
collidedWithBoat = true;
// ofc we're not vehicle
- if (!m_bIsVehicleBeingShifted && !m_phy_flagA80
+ if (!m_bIsVehicleBeingShifted && !bSkipLineCol
#ifdef VC_PED_PORTS
&& !collidingEnt->IsPed()
#endif
@@ -14671,7 +14671,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
#endif
if (bIsStanding) {
bIsStanding = false;
- m_ped_flagA2 = true;
+ bWasStanding = true;
}
bCollisionProcessed = true;
m_fCollisionSpeed += m_vecMoveSpeed.Magnitude2D() * CTimer::GetTimeStep();
@@ -14684,7 +14684,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
} else {
CVector pos = GetPosition();
float potentialGroundZ = GetPosition().z - FEET_OFFSET;
- if (m_ped_flagA2) {
+ if (bWasStanding) {
pos.z += -0.25f;
potentialGroundZ += gravityEffect;
}
@@ -14692,12 +14692,12 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
bStillOnValidPoly = true;
#ifdef VC_PED_PORTS
if(!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
- GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
if (bSomeVCflag1)
bSomeVCflag1 = false;
}
#else
- GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
#endif
m_vecMoveSpeed.z = 0.0f;
@@ -14716,7 +14716,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
// 0.52f should be a ped's approx. radius
float totalRadiusWhenCollided = collidingEnt->GetBoundRadius() + 0.52f - gravityEffect;
- if (m_ped_flagA2) {
+ if (bWasStanding) {
if (collidedWithBoat) {
potentialCenter.z += 2.0f * gravityEffect;
totalRadiusWhenCollided += Abs(gravityEffect);
@@ -14728,7 +14728,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
ourLine.p0 = GetPosition();
ourLine.p1 = GetPosition();
ourLine.p1.z = GetPosition().z - FEET_OFFSET;
- if (m_ped_flagA2) {
+ if (bWasStanding) {
ourLine.p1.z = ourLine.p1.z + gravityEffect;
ourLine.p0.z = ourLine.p0.z + -0.25f;
}
@@ -14736,7 +14736,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
intersectionPoint, minDist, false, &m_collPoly);
- if (collidedWithBoat && m_ped_flagA2 && !belowTorsoCollided) {
+ if (collidedWithBoat && bWasStanding && !belowTorsoCollided) {
ourLine.p0.z = ourLine.p1.z;
ourLine.p1.z = ourLine.p1.z + gravityEffect;
belowTorsoCollided = CCollision::ProcessVerticalLine(ourLine, collidingEnt->GetMatrix(), *hisCol,
@@ -14770,12 +14770,12 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
}
#ifdef VC_PED_PORTS
if (!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
- GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
if (bSomeVCflag1)
bSomeVCflag1 = false;
}
#else
- GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
+ GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
#endif
m_nSurfaceTouched = intersectionPoint.surfaceB;
if (m_nSurfaceTouched == SURFACE_STONE) {
@@ -14817,7 +14817,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
}
#else
float speedSqr = 0.0f;
- if (!m_ped_flagA2) {
+ if (!bWasStanding) {
if (m_vecMoveSpeed.z >= -0.25f && (speedSqr = m_vecMoveSpeed.MagnitudeSqr()) <= sq(0.5f)) {
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL) && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) {
@@ -14856,13 +14856,13 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
if (!collidingEnt->IsBuilding())
((CPhysical*)collidingEnt)->AddCollisionRecord(this);
- if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->bIsStatic)) {
+ if (ourCollidedSpheres > 0 && (collidingEnt->IsBuilding() || collidingEnt->IsStatic())) {
bHasHitWall = true;
}
}
- if (collidingEnt->IsBuilding() || collidingEnt->bIsStatic) {
+ if (collidingEnt->IsBuilding() || collidingEnt->IsStatic()) {
- if (m_ped_flagA2) {
+ if (bWasStanding) {
CVector sphereNormal;
float normalLength;
for(int sphere = 0; sphere < ourCollidedSpheres; sphere++) {
@@ -14880,7 +14880,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
float speed = m_vecMoveSpeed.Magnitude2D();
sphereNormal.x = -m_vecMoveSpeed.x / Max(0.001f, speed);
sphereNormal.y = -m_vecMoveSpeed.y / Max(0.001f, speed);
- GetPosition().z -= 0.05f;
+ GetMatrix().GetPosition().z -= 0.05f;
bSomeVCflag1 = true;
}
#endif
@@ -15106,7 +15106,7 @@ CPed::SetRadioStation(void)
if (IsPlayer() || !m_pMyVehicle || m_pMyVehicle->pDriver != this)
return;
- uint8 category = GetPedRadioCategory(m_modelIndex);
+ uint8 category = GetPedRadioCategory(GetModelIndex());
if (DMAudio.IsMP3RadioChannelAvailable()) {
if (CGeneral::GetRandomNumber() & 15) {
for (orderInCat = 0; orderInCat < 4; orderInCat++) {
@@ -15137,7 +15137,7 @@ CPed::SetRadioStation(void)
inline bool
CPed::IsNotInWreckedVehicle()
{
- return m_pMyVehicle != nil && m_pMyVehicle->m_status != STATUS_WRECKED;
+ return m_pMyVehicle != nil && m_pMyVehicle->GetStatus() != STATUS_WRECKED;
}
void
@@ -15196,7 +15196,7 @@ CPed::PreRender(void)
if (CWeather::Rain > 0.3f && TheCamera.SoundDistUp > 15.0f) {
if ((TheCamera.GetPosition() - GetPosition()).Magnitude() < 25.0f) {
bool doSplashUp = true;
- CColModel *ourCol = CModelInfo::GetModelInfo(m_modelIndex)->GetColModel();
+ CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel();
CVector speed = FindPlayerSpeed();
if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) {
@@ -15669,11 +15669,11 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
zForPed = Max(foundColZ, foundColZ2);
if (zForPed > -99.0f)
- GetPosition().z = FEET_OFFSET + zForPed;
+ GetMatrix().GetPosition().z = FEET_OFFSET + zForPed;
} else {
if (veh->GetUp().z > -0.8f) {
bool addDoorSmoke = false;
- if (veh->m_modelIndex == MI_YARDIE)
+ if (veh->GetModelIndex() == MI_YARDIE)
addDoorSmoke = true;
switch (m_vehEnterType) {
@@ -15759,9 +15759,9 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
SetRadioStation();
if (veh->pDriver == this) {
if (IsPlayer())
- veh->m_status = STATUS_PLAYER_DISABLED;
+ veh->SetStatus(STATUS_PLAYER_DISABLED);
else
- veh->m_status = STATUS_ABANDONED;
+ veh->SetStatus(STATUS_ABANDONED);
}
}
}
@@ -15915,8 +15915,8 @@ CPed::ScanForInterestingStuff(void)
for (int i = 0; i < lastVehicle; i++) {
CVehicle* veh = (CVehicle*)vehicles[i];
- if (veh->m_modelIndex == MI_MRWHOOP) {
- if (veh->m_status != STATUS_ABANDONED && veh->m_status != STATUS_WRECKED) {
+ if (veh->GetModelIndex() == MI_MRWHOOP) {
+ if (veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED) {
if ((GetPosition() - veh->GetPosition()).Magnitude() < 5.0f) {
SetObjective(OBJECTIVE_BUY_ICE_CREAM, veh);
return;
@@ -16132,11 +16132,11 @@ CPed::SeekCar(void)
SetMoveState(PEDMOVE_STILL);
return;
}
- if (vehToSeek->m_modelIndex == MI_COACH) {
+ if (vehToSeek->GetModelIndex() == MI_COACH) {
GetNearestDoor(vehToSeek, dest);
} else {
if (vehToSeek->IsTrain()) {
- if (vehToSeek->m_status != STATUS_TRAIN_NOT_MOVING) {
+ if (vehToSeek->GetStatus() != STATUS_TRAIN_NOT_MOVING) {
RestorePreviousObjective();
RestorePreviousState();
return;
@@ -16222,7 +16222,7 @@ CPed::SeekCar(void)
} else if (vehToSeek->m_nNumGettingIn < vehToSeek->m_nNumMaxPassengers + 1
&& vehToSeek->CanPedEnterCar()) {
- switch (vehToSeek->m_status) {
+ switch (vehToSeek->GetStatus()) {
case STATUS_PLAYER:
case STATUS_SIMPLE:
case STATUS_PHYSICS:
@@ -16270,7 +16270,7 @@ void
CPed::ServiceTalking(void)
{
if (!bBodyPartJustCameOff || m_bodyPartBleeding != PED_HEAD) {
- if (CGeneral::faststricmp(CModelInfo::GetModelInfo(m_modelIndex)->GetName(), "bomber")) {
+ if (CGeneral::faststricmp(CModelInfo::GetModelInfo(GetModelIndex())->GetName(), "bomber")) {
if (m_nPedState == PED_ON_FIRE)
m_queuedSound = SOUND_PED_BURNING;
} else {
@@ -16301,7 +16301,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
if (CGame::nastyGame) {
if (hitLevel == HITLEVEL_GROUND) {
CAnimBlendAssociation *floorHitAssoc;
- if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800)) {
+ if (RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL)) {
floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f);
} else {
floorHitAssoc = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, tFightMoves[FIGHTMOVE_HITONFLOOR].animId, 8.0f);
@@ -16323,7 +16323,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
}
} else if (m_nPedState == PED_FALL) {
if (hitLevel == HITLEVEL_GROUND && !IsPedHeadAbovePos(-0.3f)) {
- CAnimBlendAssociation *floorHitAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG800) ?
+ CAnimBlendAssociation *floorHitAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FRONTAL) ?
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT_F, 8.0f) :
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_FLOOR_HIT, 8.0f);
if (floorHitAssoc) {
@@ -16806,7 +16806,7 @@ CPed::SetPedPositionInCar(void)
return;
}
}
- CVehicleModelInfo *vehModel = (CVehicleModelInfo*)CModelInfo::GetModelInfo(m_pMyVehicle->m_modelIndex);
+ CVehicleModelInfo *vehModel = (CVehicleModelInfo *)CModelInfo::GetModelInfo(m_pMyVehicle->GetModelIndex());
CMatrix newMat(m_pMyVehicle->GetMatrix());
CVector seatPos;
if (m_pMyVehicle->pDriver == this) {
@@ -16924,7 +16924,7 @@ CPed::SpawnFlyingComponent(int pedNode, int8 direction)
default:
break;
}
- obj->RefModelInfo(m_modelIndex);
+ obj->RefModelInfo(GetModelIndex());
obj->AttachToRwObject((RwObject*)clump);
obj->m_fMass = 15.0f;
obj->m_fTurnMass = 5.0f;
@@ -16934,7 +16934,7 @@ CPed::SpawnFlyingComponent(int pedNode, int8 direction)
obj->ObjectCreatedBy = TEMP_OBJECT;
obj->bIsStatic = false;
obj->bIsPickup = false;
- obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SPLIT_MODEL;
+ obj->m_nSpecialCollisionResponseCases = COLLRESPONSE_SMALLBOX;
// life time - the more objects the are, the shorter this one will live
CObject::nNoTempObjects++;
@@ -16994,15 +16994,15 @@ CPed::WarpPedIntoCar(CVehicle *car)
return;
if (IsPlayer()) {
- car->m_status = STATUS_PLAYER;
+ car->SetStatus(STATUS_PLAYER);
AudioManager.PlayerJustGotInCar();
CCarCtrl::RegisterVehicleOfInterest(car);
} else {
- car->m_status = STATUS_PHYSICS;
+ car->SetStatus(STATUS_PHYSICS);
}
CWorld::Remove(this);
- GetPosition() = car->GetPosition();
+ SetPosition(car->GetPosition());
CWorld::Add(this);
if (car->bIsAmbulanceOnDuty) {
@@ -17148,7 +17148,7 @@ CPed::SetMoveAnim(void)
else
animGroupToUse = m_animGroup;
- CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG400);
+ CAnimBlendAssociation *animAssoc = RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK);
if (!animAssoc) {
CAnimBlendAssociation *fightIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
animAssoc = fightIdleAssoc;
@@ -17324,7 +17324,7 @@ CPed::WanderPath(void)
if (m_nMoveState == PEDMOVE_STILL || m_nMoveState == PEDMOVE_NONE)
SetMoveState(PEDMOVE_WALK);
}
- m_vecSeekPos = m_pNextPathNode->pos;
+ m_vecSeekPos = m_pNextPathNode->GetPosition();
m_vecSeekPos.z += 1.0f;
// Only returns true when ped is stuck(not stopped) I think, then we should assign new direction or wait state to him.
@@ -17602,7 +17602,7 @@ CPed::SetCarJack(CVehicle* car)
pedInSeat = car->pDriver;
if (m_fHealth > 0.0f && (IsPlayer() || m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS ||
- (car->VehicleCreatedBy != MISSION_VEHICLE && car->m_modelIndex != MI_DODO)))
+ (car->VehicleCreatedBy != MISSION_VEHICLE && car->GetModelIndex() != MI_DODO)))
if (pedInSeat && !pedInSeat->IsPedDoingDriveByShooting() && pedInSeat->m_nPedState == PED_DRIVING)
if (m_nPedState != PED_CARJACK && !m_pVehicleAnim)
if ((car->IsDoorReady(door) || car->IsDoorFullyOpen(door)))
@@ -17658,7 +17658,7 @@ CPed::SetExitBoat(CVehicle *boat)
m_nPedState = PED_IDLE;
CVector firstPos = GetPosition();
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 100.0f);
- if (boat->m_modelIndex == MI_SPEEDER && boat->IsUpsideDown()) {
+ if (boat->GetModelIndex() == MI_SPEEDER && boat->IsUpsideDown()) {
m_pVehicleAnim = CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, ANIM_CAR_CRAWLOUT_RHS, 8.0f);
m_pVehicleAnim->SetFinishCallback(CPed::PedSetOutCarCB, this);
m_vehEnterType = CAR_DOOR_RF;
@@ -17670,7 +17670,7 @@ CPed::SetExitBoat(CVehicle *boat)
m_pCurSurface = boat;
m_pCurSurface->RegisterReference((CEntity**)&m_pCurSurface);
}
- GetPosition() = firstPos;
+ SetPosition(firstPos);
SetMoveState(PEDMOVE_STILL);
m_vecMoveSpeed = boat->m_vecMoveSpeed;
bTryingToReachDryLand = true;
@@ -17725,10 +17725,52 @@ CPed::SetExitBoat(CVehicle *boat)
return;
}
*/ }
- GetPosition() = newPos;
+ SetPosition(newPos);
SetMoveState(PEDMOVE_STILL);
m_vecMoveSpeed = boat->m_vecMoveSpeed;
#endif
// Not there in VC.
CWaterLevel::FreeBoatWakeArray();
}
+
+#ifdef COMPATIBLE_SAVES
+void
+CPed::Save(uint8*& buf)
+{
+ SkipSaveBuf(buf, 52);
+ WriteSaveBuf<float>(buf, GetPosition().x);
+ WriteSaveBuf<float>(buf, GetPosition().y);
+ WriteSaveBuf<float>(buf, GetPosition().z);
+ SkipSaveBuf(buf, 288);
+ WriteSaveBuf<uint8>(buf, CharCreatedBy);
+ SkipSaveBuf(buf, 351);
+ WriteSaveBuf<float>(buf, m_fHealth);
+ WriteSaveBuf<float>(buf, m_fArmour);
+ SkipSaveBuf(buf, 148);
+ for (int i = 0; i < 13; i++) // has to be hardcoded
+ m_weapons[i].Save(buf);
+ SkipSaveBuf(buf, 5);
+ WriteSaveBuf<uint8>(buf, m_maxWeaponTypeAllowed);
+ SkipSaveBuf(buf, 162);
+}
+
+void
+CPed::Load(uint8*& buf)
+{
+ SkipSaveBuf(buf, 52);
+ GetMatrix().GetPosition().x = ReadSaveBuf<float>(buf);
+ GetMatrix().GetPosition().y = ReadSaveBuf<float>(buf);
+ GetMatrix().GetPosition().z = ReadSaveBuf<float>(buf);
+ SkipSaveBuf(buf, 288);
+ CharCreatedBy = ReadSaveBuf<uint8>(buf);
+ SkipSaveBuf(buf, 351);
+ m_fHealth = ReadSaveBuf<float>(buf);
+ m_fArmour = ReadSaveBuf<float>(buf);
+ SkipSaveBuf(buf, 148);
+ for (int i = 0; i < 13; i++) // has to be hardcoded
+ m_weapons[i].Load(buf);
+ SkipSaveBuf(buf, 5);
+ m_maxWeaponTypeAllowed = ReadSaveBuf<uint8>(buf);
+ SkipSaveBuf(buf, 162);
+}
+#endif
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 46c6c82d..56e527c5 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -82,7 +82,7 @@ struct FightMove
uint8 damage;
uint8 flags;
};
-static_assert(sizeof(FightMove) == 0x18, "FightMove: error");
+VALIDATE_SIZE(FightMove, 0x18);
// TODO: This is eFightState on mobile.
enum PedFightMoves
@@ -303,7 +303,7 @@ public:
// cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CPed.h from R*
uint32 bIsStanding : 1;
- uint32 m_ped_flagA2 : 1; // bWasStanding?
+ uint32 bWasStanding : 1;
uint32 bIsAttacking : 1; // doesn't reset after fist fight
uint32 bIsPointingGunAt : 1;
uint32 bIsLooking : 1;
@@ -886,21 +886,15 @@ public:
#ifdef PED_SKIN
void renderLimb(int node);
#endif
+
+#ifdef COMPATIBLE_SAVES
+ virtual void Save(uint8*& buf);
+ virtual void Load(uint8*& buf);
+#endif
};
void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
#ifndef PED_SKIN
-static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error");
-static_assert(offsetof(CPed, m_pCurSurface) == 0x2FC, "CPed: error");
-static_assert(offsetof(CPed, m_pMyVehicle) == 0x310, "CPed: error");
-static_assert(offsetof(CPed, m_nPedType) == 0x32C, "CPed: error");
-static_assert(offsetof(CPed, m_pCollidingEntity) == 0x34C, "CPed: error");
-static_assert(offsetof(CPed, m_weapons) == 0x35C, "CPed: error");
-static_assert(offsetof(CPed, m_currentWeapon) == 0x498, "CPed: error");
-static_assert(offsetof(CPed, m_lookTimer) == 0x4CC, "CPed: error");
-static_assert(offsetof(CPed, m_bodyPartBleeding) == 0x4F2, "CPed: error");
-static_assert(offsetof(CPed, m_pedInObjective) == 0x16C, "CPed: error");
-static_assert(offsetof(CPed, m_pEventEntity) == 0x19C, "CPed: error");
-static_assert(sizeof(CPed) == 0x53C, "CPed: error");
+VALIDATE_SIZE(CPed, 0x53C);
#endif
diff --git a/src/peds/PedIK.cpp b/src/peds/PedIK.cpp
index 3db3dc0f..c9428cb3 100644
--- a/src/peds/PedIK.cpp
+++ b/src/peds/PedIK.cpp
@@ -33,13 +33,18 @@ CPedIK::CPedIK(CPed *ped)
#ifdef PED_SKIN
inline RwMatrix*
-GetComponentMatrix(CPed *ped, int32 node)
+GetBoneMatrix(CPed *ped, int32 bone)
{
RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(ped->GetClump());
- int idx = RpHAnimIDGetIndex(hier, ped->m_pFrames[node]->nodeID);
+ int idx = RpHAnimIDGetIndex(hier, bone);
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
return &mats[idx];
}
+inline RwMatrix*
+GetComponentMatrix(CPed *ped, int32 node)
+{
+ return GetBoneMatrix(ped, ped->m_pFrames[node]->nodeID);
+}
#endif
void
@@ -245,7 +250,7 @@ CPedIK::LookInDirection(float phi, float theta)
}
// parent of head is torso
- RwMatrix worldMat = *GetComponentMatrix(m_ped, BONE_torso);
+ RwMatrix worldMat = *GetBoneMatrix(m_ped, BONE_torso);
ExtractYawAndPitchWorld(&worldMat, &yaw, &pitch);
LimbMoveStatus headStatus = MoveLimb(m_headOrient, CGeneral::LimitRadianAngle(phi - yaw),
diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h
index fd9e4702..a1cb5d13 100644
--- a/src/peds/PedIK.h
+++ b/src/peds/PedIK.h
@@ -64,4 +64,5 @@ public:
bool LookAtPosition(CVector const& pos);
bool RestoreLookAt(void);
};
-static_assert(sizeof(CPedIK) == 0x28, "CPedIK: error");
+
+VALIDATE_SIZE(CPedIK, 0x28);
diff --git a/src/peds/PedPlacement.cpp b/src/peds/PedPlacement.cpp
index 8b8b3dfa..2d4a92fa 100644
--- a/src/peds/PedPlacement.cpp
+++ b/src/peds/PedPlacement.cpp
@@ -37,7 +37,7 @@ CPedPlacement::FindZCoorForPed(CVector* pos)
}
CEntity*
-CPedPlacement::IsPositionClearOfCars(CVector* pos)
+CPedPlacement::IsPositionClearOfCars(Const CVector *pos)
{
return CWorld::TestSphereAgainstWorld(*pos, 0.25f, nil, true, true, false, false, false, false);
}
diff --git a/src/peds/PedPlacement.h b/src/peds/PedPlacement.h
index 6ba4ae71..b51e2aad 100644
--- a/src/peds/PedPlacement.h
+++ b/src/peds/PedPlacement.h
@@ -3,6 +3,6 @@
class CPedPlacement {
public:
static void FindZCoorForPed(CVector* pos);
- static CEntity* IsPositionClearOfCars(CVector*);
+ static CEntity* IsPositionClearOfCars(Const CVector*);
static bool IsPositionClearForPed(CVector*);
}; \ No newline at end of file
diff --git a/src/peds/PedStats.h b/src/peds/PedStats.h
index 4c35e8ee..df97bdb8 100644
--- a/src/peds/PedStats.h
+++ b/src/peds/PedStats.h
@@ -76,4 +76,5 @@ public:
static void LoadPedStats(void);
static ePedStats GetPedStatType(char *name);
};
-static_assert(sizeof(CPedStats) == 0x34, "CPedStats: error");
+
+VALIDATE_SIZE(CPedStats, 0x34);
diff --git a/src/peds/PedType.h b/src/peds/PedType.h
index c0c72550..3a765da1 100644
--- a/src/peds/PedType.h
+++ b/src/peds/PedType.h
@@ -91,4 +91,4 @@ public:
static bool IsThreat(int type, int threat) { return ms_apPedType[type]->m_threats & threat; }
};
-static_assert(sizeof(CPedType) == 0x20, "CPedType: error");
+VALIDATE_SIZE(CPedType, 0x20);
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 664fff18..c6c4824b 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -19,6 +19,13 @@
#define PAD_MOVE_TO_GAME_WORLD_MOVE 60.0f
+const uint32 CPlayerPed::nSaveStructSize =
+#ifdef COMPATIBLE_SAVES
+ 1520;
+#else
+ sizeof(CPlayerPed);
+#endif
+
CPlayerPed::~CPlayerPed()
{
delete m_pWanted;
@@ -771,7 +778,7 @@ CPlayerPed::KeepAreaAroundPlayerClear(void)
for (int i = 0; i < lastVehicle; i++) {
CVehicle *veh = (CVehicle*)vehicles[i];
if (veh->VehicleCreatedBy != MISSION_VEHICLE) {
- if (veh->m_status != STATUS_PLAYER && veh->m_status != STATUS_PLAYER_DISABLED) {
+ if (veh->GetStatus() != STATUS_PLAYER && veh->GetStatus() != STATUS_PLAYER_DISABLED) {
if ((veh->GetPosition() - playerPos).MagnitudeSqr() > 25.0f) {
veh->AutoPilot.m_nTempAction = TEMPACT_WAIT;
veh->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 5000;
@@ -1320,7 +1327,7 @@ CPlayerPed::ProcessControl(void)
case PED_ATTACK:
case PED_FIGHT:
case PED_AIM_GUN:
- if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_FLAG400)) {
+ if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) {
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) {
if (padUsed)
PlayerControl1stPersonRunAround(padUsed);
@@ -1504,3 +1511,33 @@ CPlayerPed::ProcessControl(void)
UpdateRpHAnim();
#endif
}
+
+#ifdef COMPATIBLE_SAVES
+void
+CPlayerPed::Save(uint8*& buf)
+{
+ CPed::Save(buf);
+ SkipSaveBuf(buf, 16);
+ WriteSaveBuf<float>(buf, m_fMaxStamina);
+ SkipSaveBuf(buf, 28);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[0]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[1]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[2]);
+ WriteSaveBuf<int32>(buf, m_nTargettableObjects[3]);
+ SkipSaveBuf(buf, 116);
+}
+
+void
+CPlayerPed::Load(uint8*& buf)
+{
+ CPed::Load(buf);
+ SkipSaveBuf(buf, 16);
+ m_fMaxStamina = ReadSaveBuf<float>(buf);
+ SkipSaveBuf(buf, 28);
+ m_nTargettableObjects[0] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[1] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[2] = ReadSaveBuf<int32>(buf);
+ m_nTargettableObjects[3] = ReadSaveBuf<int32>(buf);
+ SkipSaveBuf(buf, 116);
+}
+#endif
diff --git a/src/peds/PlayerPed.h b/src/peds/PlayerPed.h
index b8bd57e4..e8173c8c 100644
--- a/src/peds/PlayerPed.h
+++ b/src/peds/PlayerPed.h
@@ -75,8 +75,15 @@ public:
static void SetupPlayerPed(int32);
static void DeactivatePlayerPed(int32);
static void ReactivatePlayerPed(int32);
+
+#ifdef COMPATIBLE_SAVES
+ virtual void Save(uint8*& buf);
+ virtual void Load(uint8*& buf);
+#endif
+
+ static const uint32 nSaveStructSize;
};
#ifndef PED_SKIN
-static_assert(sizeof(CPlayerPed) == 0x5F0, "CPlayerPed: error");
+VALIDATE_SIZE(CPlayerPed, 0x5F0);
#endif
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index cd89a05d..1566ba3d 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -396,7 +396,7 @@ CPopulation::FindCollisionZoneForCoors(CVector *coors, int *safeZoneOut, eLevelN
if (*safeZoneOut >= 0)
*levelOut = LEVEL_NONE;
else
- *levelOut = CTheZones::GetLevelFromPosition(*coors);
+ *levelOut = CTheZones::GetLevelFromPosition(coors);
}
void
@@ -495,7 +495,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_CIVFEMALE:
{
CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
if (ms_bGivePedsWeapons) {
@@ -509,7 +509,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_COP:
{
CCopPed *ped = new CCopPed((eCopType)miOrCopType);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
return ped;
@@ -525,7 +525,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_GANG9:
{
CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
@@ -540,7 +540,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_EMERGENCY:
{
CEmergencyPed *ped = new CEmergencyPed(PEDTYPE_EMERGENCY);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
return ped;
@@ -548,7 +548,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_FIREMAN:
{
CEmergencyPed *ped = new CEmergencyPed(PEDTYPE_FIREMAN);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
return ped;
@@ -557,7 +557,7 @@ CPopulation::AddPed(ePedType pedType, uint32 miOrCopType, CVector const &coors)
case PEDTYPE_PROSTITUTE:
{
CCivilianPed *ped = new CCivilianPed(pedType, miOrCopType);
- ped->GetPosition() = coors;
+ ped->SetPosition(coors);
ped->SetOrientation(0.0f, 0.0f, 0.0f);
CWorld::Add(ped);
return ped;
@@ -755,7 +755,7 @@ CPopulation::AddPedInCar(CVehicle* car)
int preferredModel;
CTheZones::GetZoneInfoForTimeOfDay(&coors, &zoneInfo);
- switch (car->m_modelIndex) {
+ switch (car->GetModelIndex()) {
case MI_FIRETRUCK:
preferredModel = 0;
pedType = PEDTYPE_FIREMAN;
@@ -796,14 +796,14 @@ CPopulation::AddPedInCar(CVehicle* car)
int gangOfPed = 0;
imSureThatModelIsLoaded = false;
- while (gangOfPed < NUM_GANGS && CGangs::GetGangInfo(gangOfPed)->m_nVehicleMI != car->m_modelIndex)
+ while (gangOfPed < NUM_GANGS && CGangs::GetGangInfo(gangOfPed)->m_nVehicleMI != car->GetModelIndex())
gangOfPed++;
if (gangOfPed < NUM_GANGS) {
pedType = gangOfPed + PEDTYPE_GANG1;
preferredModel = ChooseGangOccupation(gangOfPed);
} else if (gangOfPed == NUM_GANGS) {
- CVehicleModelInfo *carModelInfo = ((CVehicleModelInfo*)CModelInfo::GetModelInfo(car->m_modelIndex));
+ CVehicleModelInfo *carModelInfo = ((CVehicleModelInfo *)CModelInfo::GetModelInfo(car->GetModelIndex()));
int i = 15;
for(; i >= 0; i--) {
// Should return random model each time
@@ -869,8 +869,8 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex);
if (veh && veh->m_nZoneLevel == LEVEL_NONE && veh->IsCar()) {
- if(veh->m_status != STATUS_ABANDONED && veh->m_status != STATUS_WRECKED && veh->m_status != STATUS_PLAYER &&
- veh->m_status != STATUS_PLAYER_REMOTE) {
+ if(veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_PLAYER &&
+ veh->GetStatus() != STATUS_PLAYER_REMOTE) {
CVector vehPos(veh->GetPosition());
CPopulation::FindCollisionZoneForCoors(&vehPos, &zone, &level);
@@ -880,22 +880,22 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
if (veh->bIsLocked || !veh->CanBeDeleted()) {
switch (movedVehicleCount & 3) {
case 0:
- veh->GetPosition() = RegenerationPoint_a;
+ veh->SetPosition(RegenerationPoint_a);
break;
case 1:
- veh->GetPosition() = RegenerationPoint_b;
+ veh->SetPosition(RegenerationPoint_b);
break;
case 2:
- veh->GetPosition() = CVector(RegenerationPoint_a.x, RegenerationPoint_b.y, RegenerationPoint_a.z);
+ veh->SetPosition(RegenerationPoint_a.x, RegenerationPoint_b.y, RegenerationPoint_a.z);
break;
case 3:
- veh->GetPosition() = CVector(RegenerationPoint_b.x, RegenerationPoint_a.y, RegenerationPoint_a.z);
+ veh->SetPosition(RegenerationPoint_b.x, RegenerationPoint_a.y, RegenerationPoint_a.z);
break;
default:
break;
}
- veh->GetPosition().z += (movedVehicleCount / 4) * 7.0f;
- veh->GetForward() = RegenerationForward;
+ veh->GetMatrix().GetPosition().z += (movedVehicleCount / 4) * 7.0f;
+ veh->GetMatrix().GetForward() = RegenerationForward;
((CAutomobile*)veh)->PlaceOnRoadProperly();
CCarCtrl::JoinCarWithRoadSystem(veh);
CTheScripts::ClearSpaceForMissionEntity(veh->GetPosition(), veh);
@@ -924,14 +924,14 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
CWorld::Remove(ped);
delete ped;
} else if (ped->m_nPedType != PEDTYPE_PLAYER1 && ped->m_nPedType != PEDTYPE_PLAYER2) {
- ped->GetPosition() = RegenerationPoint_a;
+ ped->SetPosition(RegenerationPoint_a);
bool foundGround;
float groundZ = CWorld::FindGroundZFor3DCoord(ped->GetPosition().x, ped->GetPosition().y,
ped->GetPosition().z + 2.0f, &foundGround);
if (foundGround) {
- ped->GetPosition().z = 1.0f + groundZ;
+ ped->GetMatrix().GetPosition().z = 1.0f + groundZ;
//ped->GetPosition().z += 0.0f;
CTheScripts::ClearSpaceForMissionEntity(ped->GetPosition(), ped);
}
@@ -970,7 +970,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
CWorld::Remove(dummy);
delete dummy;
CWorld::Add(obj);
- int16 mi = obj->m_modelIndex;
+ int16 mi = obj->GetModelIndex();
if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 ||
mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8)
makeInvisible = true;
@@ -979,7 +979,7 @@ CPopulation::ConvertToRealObject(CDummyObject *dummy)
if (makeInvisible) {
obj->bIsVisible = false;
- } else if (obj->m_modelIndex == MI_BUOY) {
+ } else if (obj->GetModelIndex() == MI_BUOY) {
obj->bIsStatic = false;
obj->m_vecMoveSpeed = CVector(0.0f, 0.0f, -0.001f);
obj->bTouchingWater = true;
@@ -997,7 +997,7 @@ CPopulation::ConvertToDummyObject(CObject *obj)
dummy->UpdateRwFrame();
bool makeInvisible;
- int16 mi = obj->m_modelIndex;
+ int16 mi = obj->GetModelIndex();
if (mi == MI_GLASS1 || mi == MI_GLASS2 || mi == MI_GLASS3 || mi == MI_GLASS4 ||
mi == MI_GLASS5 || mi == MI_GLASS6 || mi == MI_GLASS7 || mi == MI_GLASS8)
makeInvisible = true;
@@ -1017,8 +1017,7 @@ bool
CPopulation::TestRoomForDummyObject(CObject *obj)
{
int16 collidingObjs;
- CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(),
- CModelInfo::GetModelInfo(obj->m_modelIndex)->GetColModel()->boundingSphere.radius,
+ CWorld::FindObjectsKindaColliding(obj->m_objectMatrix.GetPosition(), CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel()->boundingSphere.radius,
false, &collidingObjs, 2, nil, false, true, true, false, false);
return collidingObjs == 0;