another crash bug fix

some code style fixes
This commit is contained in:
jeefo 2015-08-03 12:36:57 +03:00
commit f3e583e057
3 changed files with 10 additions and 11 deletions

View file

@ -1673,7 +1673,7 @@ void Bot::CheckReload (void)
break;
}
if (m_ammoInClip[weaponIndex] < (maxClip * 0.8) && m_ammo[g_weaponDefs[weaponIndex].ammo1] > 0)
if (m_ammoInClip[weaponIndex] < (maxClip * 0.8) && g_weaponDefs[m_currentWeapon].ammo1 != -1 && g_weaponDefs[m_currentWeapon].ammo1 < 32 && m_ammo[g_weaponDefs[weaponIndex].ammo1] > 0)
{
if (m_currentWeapon != weaponIndex)
SelectWeaponByName (g_weaponDefs[weaponIndex].className);