diff --git a/source/duke3d/src/config.cpp b/source/duke3d/src/config.cpp index 9122a7df1..fbc255e18 100644 --- a/source/duke3d/src/config.cpp +++ b/source/duke3d/src/config.cpp @@ -46,23 +46,10 @@ hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL }; int32_t CONFIG_FunctionNameToNum(const char *func) { - int32_t i; - if (!func) return -1; - i = hash_find(&h_gamefuncs,func); - - if (i < 0) - { - char *str = Bstrtolower(Xstrdup(func)); - i = hash_find(&h_gamefuncs,str); - Bfree(str); - - return i; - } - - return i; + return hash_findcase(&h_gamefuncs, func); } diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 9d919dfa6..9faf3f2e6 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6243,10 +6243,7 @@ int app_main(int argc, char const * const * argv) if (gamefunctions[i][0] == '\0') continue; - char *str = Bstrtolower(Xstrdup(gamefunctions[i])); hash_add(&h_gamefuncs,gamefunctions[i],i,0); - hash_add(&h_gamefuncs,str,i,0); - Bfree(str); } #ifdef STARTUP_SETUP_WINDOW diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index fb35ede43..90799e4ce 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -5195,12 +5195,7 @@ repeatcase: i = 0; - { - hash_delete(&h_gamefuncs, gamefunctions[j]); - char *str = Bstrtolower(Xstrdup(gamefunctions[j])); - hash_delete(&h_gamefuncs, str); - Bfree(str); - } + hash_delete(&h_gamefuncs, gamefunctions[j]); while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { @@ -5225,11 +5220,6 @@ repeatcase: } gamefunctions[j][i] = '\0'; hash_add(&h_gamefuncs,gamefunctions[j],j,0); - { - char *str = Bstrtolower(Xstrdup(gamefunctions[j])); - hash_add(&h_gamefuncs,str,j,0); - Bfree(str); - } continue; @@ -5248,12 +5238,7 @@ repeatcase: continue; } - { - hash_delete(&h_gamefuncs, gamefunctions[j]); - char *str = Bstrtolower(Xstrdup(gamefunctions[j])); - hash_delete(&h_gamefuncs, str); - Bfree(str); - } + hash_delete(&h_gamefuncs, gamefunctions[j]); gamefunctions[j][0] = '\0';