diff --git a/core/ConVarManager.cpp b/core/ConVarManager.cpp index e3dfafac..97639565 100644 --- a/core/ConVarManager.cpp +++ b/core/ConVarManager.cpp @@ -41,7 +41,7 @@ ConVarManager g_ConVarManager; const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String}; typedef List ConVarList; -NameHashSet convar_cache; +NameHashSet convar_cache; class ConVarReentrancyGuard { diff --git a/core/ConVarManager.h b/core/ConVarManager.h index f39cd295..ad2fe376 100644 --- a/core/ConVarManager.h +++ b/core/ConVarManager.h @@ -64,14 +64,26 @@ struct ConVarInfo ConVar *pVar; /**< The actual convar */ List changeListeners; - static inline bool matches(const char *name, const ConVarInfo *info) + struct ConVarPolicy { - return strcmp(name, info->pVar->GetName()) == 0; - } - static inline uint32_t hash(const detail::CharsAndLength &key) - { - return key.hash(); - } + static inline bool matches(const char *name, ConVarInfo *info) + { + const char *conVarChars = info->pVar->GetName(); + + ke::AString convarName = ke::AString(conVarChars).lowercase(); + ke::AString input = ke::AString(name).lowercase(); + + return convarName == input; + } + + static inline uint32_t hash(const detail::CharsAndLength &key) + { + ke::AString original(key.chars()); + ke::AString lower = original.lowercase(); + + return detail::CharsAndLength(lower.chars()).hash(); + } + }; }; /**