fixed another potential crash bug

This commit is contained in:
jeefo 2015-08-03 10:26:08 +03:00
commit 6b4a7f9ffd

View file

@ -5213,7 +5213,7 @@ bool Bot::HasHostage (void)
int Bot::GetAmmo (void)
{
if (g_weaponDefs[m_currentWeapon].ammo1 == -1)
if (g_weaponDefs[m_currentWeapon].ammo1 == -1 || g_weaponDefs[m_currentWeapon].ammo1 > 31)
return 0;
return m_ammo[g_weaponDefs[m_currentWeapon].ammo1];