summaryrefslogtreecommitdiffstats
path: root/src/peds/Ped.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/Ped.cpp')
-rw-r--r--src/peds/Ped.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 8d0fbbe8..3ccae5d0 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -393,8 +393,20 @@ CPed::BuildPedLists(void)
if (ped != this && !ped->bInVehicle) {
float dist = (ped->GetPosition() - GetPosition()).Magnitude2D();
if (nThreatReactionRangeMultiplier * 30.0f > dist) {
+#ifdef FIX_BUGS
+ // If the gap ped list is full, sort it and truncate it
+ // before pushing more unsorted peds
+ if( gnNumTempPedList == ARRAY_SIZE(gapTempPedList) - 1 )
+ {
+ gapTempPedList[gnNumTempPedList] = nil;
+ SortPeds(gapTempPedList, 0, gnNumTempPedList - 1);
+ gnNumTempPedList = ARRAY_SIZE(m_nearPeds);
+ }
+#endif
+
gapTempPedList[gnNumTempPedList] = ped;
gnNumTempPedList++;
+ // NOTE: We cannot absolutely fill the gap list, as the list is null-terminated before being passed to SortPeds
assert(gnNumTempPedList < ARRAY_SIZE(gapTempPedList));
}
}
@@ -1348,6 +1360,9 @@ CPed::CalculateNewVelocity(void)
limitedRotDest -= 2 * PI;
}
+#ifdef FREE_CAM
+ if (!TheCamera.Cams[0].Using3rdPersonMouseCam())
+#endif
if (IsPlayer() && m_nPedState == PED_ATTACK)
headAmount /= 4.0f;