summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/peds/Ped.cpp12
-rw-r--r--src/peds/Population.cpp13
2 files changed, 13 insertions, 12 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index fc57719d..6d88db99 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2208,7 +2208,7 @@ CPed::ProcessControl(void)
Say(SOUND_PED_DAMAGE);
}
- CColModel* collidingCol = CModelInfo::GetModelInfo(collidingVeh->m_modelIndex)->GetColModel();
+ CColModel *collidingCol = CModelInfo::GetColModel(collidingVeh->m_modelIndex);
CVector colMinVec = collidingCol->boundingBox.min;
CVector colMaxVec = collidingCol->boundingBox.max;
@@ -2900,8 +2900,8 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
CColPoint intersectionPoint;
CColLine ourLine;
- CColModel *ourCol = CModelInfo::GetModelInfo(GetModelIndex())->GetColModel();
- CColModel *hisCol = CModelInfo::GetModelInfo(collidingEnt->GetModelIndex())->GetColModel();
+ CColModel *ourCol = CModelInfo::GetColModel(GetModelIndex());
+ CColModel *hisCol = CModelInfo::GetColModel(collidingEnt->GetModelIndex());
if (!bUsesCollision && !bJustCheckCollision)
return 0;
@@ -3418,7 +3418,7 @@ void
CPed::SetDirectionToWalkAroundObject(CEntity *obj)
{
float distLimitForTimer = 8.0f;
- CColModel *objCol = CModelInfo::GetModelInfo(obj->GetModelIndex())->GetColModel();
+ CColModel *objCol = CModelInfo::GetColModel(obj->GetModelIndex());
CVector objColMin = objCol->boundingBox.min;
CVector objColMax = objCol->boundingBox.max;
CVector objColCenter = (objColMin + objColMax) / 2.0f;
@@ -4967,7 +4967,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(GetModelIndex())->GetColModel();
+ CColModel *ourCol = CModelInfo::GetColModel(GetModelIndex());
CVector speed = FindPlayerSpeed();
if (Abs(speed.x) <= 0.05f && Abs(speed.y) <= 0.05f) {
@@ -9424,7 +9424,7 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg)
return;
CVector forward(0.09f * ped->GetForward() + ped->GetPosition());
- forward.z += CModelInfo::GetModelInfo(ped->GetModelIndex())->GetColModel()->spheres[2].center.z + 0.35f;
+ forward.z += CModelInfo::GetColModel(ped->GetModelIndex())->spheres[2].center.z + 0.35f;
CEntity *obstacle = CWorld::TestSphereAgainstWorld(forward, 0.25f, nil, true, true, false, true, false, false);
if (!obstacle) {
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 75c454b6..6a2e5a8f 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -40,8 +40,8 @@ bool CPopulation::ms_bGivePedsWeapons;
int32 CPopulation::m_AllRandomPedsThisType = -1;
float CPopulation::PedDensityMultiplier = 1.0f;
uint32 CPopulation::ms_nTotalMissionPeds;
-int32 CPopulation::MaxNumberOfPedsInUse = 25;
-int32 CPopulation::MaxNumberOfPedsInUseInterior = 40;
+int32 CPopulation::MaxNumberOfPedsInUse = DEFAULT_MAX_NUMBER_OF_PEDS;
+int32 CPopulation::MaxNumberOfPedsInUseInterior = DEFAULT_MAX_NUMBER_OF_PEDS_INTERIOR;
uint32 CPopulation::ms_nNumCivMale;
uint32 CPopulation::ms_nNumCivFemale;
uint32 CPopulation::ms_nNumCop;
@@ -1095,6 +1095,7 @@ CPopulation::ManagePopulation(void)
}
float dist = (ped->GetPosition() - playerPos).Magnitude2D();
+
bool pedIsFarAway = false;
if (ped->IsGangMember())
@@ -1515,7 +1516,7 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
int gangModel = ChooseGangOccupation(pedType - PEDTYPE_GANG1);
if (((CPedModelInfo*)CModelInfo::GetModelInfo(gangModel))->GetRwObject()) {
CEntity* obstacles[6] = { nil, nil, nil, nil, nil, nil };
- CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetModelInfo(gangModel)->GetColModel()->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
+ CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetColModel(gangModel)->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
bool foundObstacle = false;
for (int m = 0; m < ARRAY_SIZE(obstacles); m++) {
CEntity* obstacle = obstacles[m];
@@ -1599,7 +1600,7 @@ CPopulation::PlaceCouple(ePedType manType, int32 manModel, ePedType womanType, i
return;
if (!TheCamera.IsSphereVisible(coors, 1.5f) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) {
- if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetModelInfo(manModel)->GetColModel()->boundingSphere.radius, -1, nil)) {
+ if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetColModel(manModel)->boundingSphere.radius, -1, nil)) {
bool manFoundGround;
float manGroundZ = CWorld::FindGroundZFor3DCoord(coors.x, coors.y, coors.z, &manFoundGround) + 1.0f;
if (manFoundGround) {
@@ -1633,7 +1634,7 @@ CPopulation::PlaceCouple(ePedType manType, int32 manModel, ePedType womanType, i
CEntity* obstacles[3];
memcpy(obstacles, gCoupleObstacles, sizeof(gCoupleObstacles));
- CPedPlacement::IsPositionClearForPed(womanPos, CModelInfo::GetModelInfo(womanModel)->GetColModel()->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
+ CPedPlacement::IsPositionClearForPed(womanPos, CModelInfo::GetColModel(womanModel)->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
for (int i = 0; i < ARRAY_SIZE(obstacles); i++) {
CEntity *obstacle = obstacles[i];
if (obstacle) {
@@ -1709,7 +1710,7 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
if (pedModelInfo->GetRwObject()) {
CEntity* obstacles[6] = { nil, nil, nil, nil, nil, nil };
- CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetModelInfo(pedModel)->GetColModel()->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
+ CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetColModel(pedModel)->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles);
bool foundObstacle = false;
for (int m = 0; m < ARRAY_SIZE(obstacles); m++) {
CEntity* obstacle = obstacles[m];