mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-24 21:41:23 +00:00
fixed potential bug.
This commit is contained in:
parent
b3dc1ee9c6
commit
5a9cdc2ed8
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue