summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-06-30 03:12:59 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-06-30 03:12:59 +0200
commitcac1c5bd420ee87a42bccfbea669abfadb6cacdb (patch)
tree29b89d84f7b4594bea42170ced130dab01ec42fe /src
parentSanitizer fixes (diff)
downloadre3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar.gz
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar.bz2
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar.lz
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar.xz
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.tar.zst
re3-cac1c5bd420ee87a42bccfbea669abfadb6cacdb.zip
Diffstat (limited to 'src')
-rw-r--r--src/peds/PlayerPed.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index d54dedd9..9f75b155 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -2080,13 +2080,13 @@ CPlayerPed::UpdateMeleeAttackers(void)
void
CPlayerPed::RemovePedFromMeleeList(CPed *ped)
{
- int i = 0;
- while (m_pMeleeList[i] != ped) {
- if (++i >= ARRAY_SIZE(m_pMeleeList))
+ for (uint16 i = 0; i < ARRAY_SIZE(m_pMeleeList); i++) {
+ if (m_pMeleeList[i] == ped) {
+ m_pMeleeList[i] = nil;
+ ped->m_attackTimer = 0;
return;
+ }
}
- m_pMeleeList[i] = nil;
- ped->m_attackTimer = 0;
}
void