Fix OOB access on CBaseCombatCharacter::m_hMyWeapons

This commit is contained in:
samisalreadytaken 2024-11-22 16:35:33 +03:00
parent 5d50335c02
commit 7ebb26c996

View File

@ -8045,10 +8045,13 @@ int CAI_BaseNPC::UnholsterWeapon( void )
if (i == -1) if (i == -1)
{ {
// Set i to the first weapon you can find // Set i to the first weapon you can find
for (i = 0; i < WeaponCount(); i++) for (i = 0;;)
{ {
if (GetWeapon(i)) if (GetWeapon(i))
break; break;
if (++i >= WeaponCount())
return -1;
} }
} }
#else #else