diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-01 11:54:20 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-08-01 11:54:20 +0200 |
commit | 1479093d338a06fe84603ce04a989863cddac486 (patch) | |
tree | dac491860d0da766aa179b8d0bf82f7051ec4816 /src/peds/Ped.cpp | |
parent | mission replay (diff) | |
parent | Fix radio scroll when player controls disabled (diff) | |
download | re3-1479093d338a06fe84603ce04a989863cddac486.tar re3-1479093d338a06fe84603ce04a989863cddac486.tar.gz re3-1479093d338a06fe84603ce04a989863cddac486.tar.bz2 re3-1479093d338a06fe84603ce04a989863cddac486.tar.lz re3-1479093d338a06fe84603ce04a989863cddac486.tar.xz re3-1479093d338a06fe84603ce04a989863cddac486.tar.zst re3-1479093d338a06fe84603ce04a989863cddac486.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)); } } |