mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-21 20:21:19 +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 ) {
|
const char *idWeapon::GetAmmoNameForNum( ammo_t ammonum ) {
|
||||||
int i;
|
int i, j;
|
||||||
int num;
|
int num;
|
||||||
const idDict *ammoDict;
|
const idDict *ammoDict;
|
||||||
const idKeyValue *kv;
|
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 );
|
ammoDict = gameLocal.FindEntityDefDict( va("ammo_types_%s", gamedir.c_str()), false );
|
||||||
if ( ammoDict ) {
|
if ( ammoDict ) {
|
||||||
num = ammoDict->GetNumKeyVals();
|
num = ammoDict->GetNumKeyVals();
|
||||||
for( i = 0; i < num; i++ ) {
|
for( j = 0; j < num; j++ ) {
|
||||||
kv = ammoDict->GetKeyVal( i );
|
kv = ammoDict->GetKeyVal( j );
|
||||||
if ( kv->GetValue() == text ) {
|
if ( kv->GetValue() == text ) {
|
||||||
return kv->GetKey();
|
return kv->GetKey();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue