From 894495689f860631fa2f084769473296281a0d85 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Mon, 12 Jul 2021 23:51:28 -0700 Subject: Fix NearPed count going negative --- src/peds/Ped.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 4d80cac2..90aebf89 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -326,6 +326,7 @@ CPed::~CPed(void) nearPed->m_nearPeds[k] = nearPed->m_nearPeds[k + 1]; nearPed->m_nearPeds[k + 1] = nil; } + nearPed->m_nearPeds[ARRAY_SIZE(m_nearPeds) - 1] = nil; nearPed->m_numNearPeds--; } else j++; -- cgit v1.2.3