diff options
author | Magnus Larsen <golgothasTerror101@gmail.com> | 2021-07-27 04:23:37 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-07-31 19:34:32 +0200 |
commit | d923cd2f240d29a062c91a2b00c110f74986f281 (patch) | |
tree | f0e596609499ff30b70a90fee1d651ab65a90b01 /src/peds/Ped.cpp | |
parent | Make cars and peds to not despawn when you look away (diff) | |
download | re3-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/peds/Ped.cpp')
-rw-r--r-- | src/peds/Ped.cpp | 12 |
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)); } } |