summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMagnus Larsen <golgothasTerror101@gmail.com>2021-07-27 04:23:37 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-31 19:34:32 +0200
commitd923cd2f240d29a062c91a2b00c110f74986f281 (patch)
treef0e596609499ff30b70a90fee1d651ab65a90b01 /src
parentMake cars and peds to not despawn when you look away (diff)
downloadre3-d923cd2f240d29a062c91a2b00c110f74986f281.tar
re3-d923cd2f240d29a062c91a2b00c110f74986f281.tar.gz
re3-d923cd2f240d29a062c91a2b00c110f74986f281.tar.bz2
re3-d923cd2f240d29a062c91a2b00c110f74986f281.tar.lz
re3-d923cd2f240d29a062c91a2b00c110f74986f281.tar.xz
re3-d923cd2f240d29a062c91a2b00c110f74986f281.tar.zst
re3-d923cd2f240d29a062c91a2b00c110f74986f281.zip
Diffstat (limited to 'src')
-rw-r--r--src/peds/Ped.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index eadd9d64..7194d824 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -511,8 +511,20 @@ CPed::BuildPedLists(void)
continue;
deadsRegistered++;
}
+#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));
}
}