From 82cbc94f2752567c1e07435dc0ebb6df5d43f5ce Mon Sep 17 00:00:00 2001 From: HttrckCldHKS Date: Sat, 18 Oct 2014 10:58:26 -0700 Subject: [PATCH] Improving Code --- amxmodx/meta_api.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 78ef34d6..1253b5d2 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -145,9 +145,10 @@ int FF_ChangeLevel = -1; bool ColoredMenus(String & ModName) { - const char * pModNames[] = { "cstrike", "czero", "dmc", "dod", "tfc", "valve" }; + static const char * pModNames[] = { "cstrike", "czero", "dmc", "dod", "tfc", "valve" }; + static const size_t ModsCount = sizeof(pModNames) / sizeof(const char *); - for (int Iterator = 0u; Iterator < sizeof(pModNames) / sizeof(const char *); ++Iterator) + for (int Iterator = 0u; Iterator < ModsCount; ++Iterator) { if (ModName.compare(pModNames[Iterator]) == 0u) return true; // this game modification currently supports colored menus