From 5a9cdc2ed80f6e6f6946122cbb68458dc7edf212 Mon Sep 17 00:00:00 2001 From: Zohar Malamant Date: Thu, 15 Aug 2013 01:02:38 +0200 Subject: [PATCH] fixed potential bug. --- d3xp/Weapon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/d3xp/Weapon.cpp b/d3xp/Weapon.cpp index 06a0fab..2101381 100644 --- a/d3xp/Weapon.cpp +++ b/d3xp/Weapon.cpp @@ -2505,7 +2505,7 @@ idWeapon::GetAmmoNameForNum ================ */ const char *idWeapon::GetAmmoNameForNum( ammo_t ammonum ) { - int i; + int i, j; int num; const idDict *ammoDict; const idKeyValue *kv; @@ -2539,8 +2539,8 @@ const char *idWeapon::GetAmmoNameForNum( ammo_t ammonum ) { ammoDict = gameLocal.FindEntityDefDict( va("ammo_types_%s", gamedir.c_str()), false ); if ( ammoDict ) { num = ammoDict->GetNumKeyVals(); - for( i = 0; i < num; i++ ) { - kv = ammoDict->GetKeyVal( i ); + for( j = 0; j < num; j++ ) { + kv = ammoDict->GetKeyVal( j ); if ( kv->GetValue() == text ) { return kv->GetKey(); }