From 9721c025c10c8755cee85bd8ee8ac816972d9d3e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 20 Feb 2015 20:42:30 -0600 Subject: [PATCH] Remove unneeded index restriction from GetUDMFInt/Fixed --- src/p_udmf.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 541d7d396..64e8605e7 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -343,17 +343,14 @@ int GetUDMFInt(int type, int index, const char *key) { 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); - if (pKey != NULL) - { - return pKey->IntVal; - } + return pKey->IntVal; } } return 0; @@ -363,17 +360,14 @@ fixed_t GetUDMFFixed(int type, int index, const char *key) { 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); - if (pKey != NULL) - { - return FLOAT2FIXED(pKey->FloatVal); - } + return FLOAT2FIXED(pKey->FloatVal); } } return 0;