Remove unneeded index restriction from GetUDMFInt/Fixed

This commit is contained in:
Randy Heit 2015-02-20 20:42:30 -06:00
parent a64ebc720b
commit 9721c025c1

View file

@ -343,17 +343,14 @@ int GetUDMFInt(int type, int index, const char *key)
{ {
assert(type >=0 && type <=3); assert(type >=0 && type <=3);
if (index > 0) FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
{
FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
if (pKeys != NULL) if (pKeys != NULL)
{
FUDMFKey *pKey = pKeys->Find(key);
if (pKey != NULL)
{ {
FUDMFKey *pKey = pKeys->Find(key); return pKey->IntVal;
if (pKey != NULL)
{
return pKey->IntVal;
}
} }
} }
return 0; return 0;
@ -363,17 +360,14 @@ fixed_t GetUDMFFixed(int type, int index, const char *key)
{ {
assert(type >=0 && type <=3); assert(type >=0 && type <=3);
if (index > 0) FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
{
FUDMFKeys *pKeys = UDMFKeys[type].CheckKey(index);
if (pKeys != NULL) if (pKeys != NULL)
{
FUDMFKey *pKey = pKeys->Find(key);
if (pKey != NULL)
{ {
FUDMFKey *pKey = pKeys->Find(key); return FLOAT2FIXED(pKey->FloatVal);
if (pKey != NULL)
{
return FLOAT2FIXED(pKey->FloatVal);
}
} }
} }
return 0; return 0;