From 6b4a7f9ffde086bd5f1377db50df0503fdc6c336 Mon Sep 17 00:00:00 2001 From: jeefo Date: Mon, 3 Aug 2015 10:26:08 +0300 Subject: [PATCH] fixed another potential crash bug --- source/basecode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basecode.cpp b/source/basecode.cpp index 4ce8ffd..0ff0e5a 100644 --- a/source/basecode.cpp +++ b/source/basecode.cpp @@ -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];