From 9223989a01201f51e5aa680b45f0ff4917c980e0 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Thu, 16 Jul 2015 07:49:46 +0200 Subject: [PATCH] Fix consistency --- amxmodx/CLang.cpp | 6 +++--- amxmodx/format.cpp | 8 +++++--- modules/ns/Hash.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/amxmodx/CLang.cpp b/amxmodx/CLang.cpp index 38eddcdf..65bcf762 100755 --- a/amxmodx/CLang.cpp +++ b/amxmodx/CLang.cpp @@ -25,18 +25,18 @@ template<> int Compare(const ke::AString &k1, const ke::AString &k2) { - return k1.compare(k2.chars()); + return k1.compare(k2); } template<> int CompareAlt(char const * const &k1, ke::AString const &k2) { - return strcmp(k1, k2.chars()); + return k2.compare(k1); } template<> int CompareAlt(ke::AString const &k1, ke::AString const &k2) { - return strcmp(k1.chars(), k2.chars()); + return k1.compare(k2); } template<> diff --git a/amxmodx/format.cpp b/amxmodx/format.cpp index a5c2baa9..9f3e9ed0 100644 --- a/amxmodx/format.cpp +++ b/amxmodx/format.cpp @@ -112,14 +112,16 @@ const char *translate(AMX *amx, cell amxaddr, const char *key) if (def == NULL) { - if (debug) + if (debug && status == ERR_BADLANG) { ke::AString lang(pLangName); - if (status == ERR_BADLANG && (BadLang_Table.AltFindOrInsert(ke::Move(lang)).last + 120.0f < gpGlobals->time)) + lang_err &err = BadLang_Table.AltFindOrInsert(ke::Move(lang)); + + if (err.last + 120.0f < gpGlobals->time) { AMXXLOG_Error("[AMXX] Language \"%s\" not found", pLangName); - BadLang_Table.AltFindOrInsert(ke::Move(lang)).last = gpGlobals->time; + err.last = gpGlobals->time; } } diff --git a/modules/ns/Hash.h b/modules/ns/Hash.h index f20c997c..a09f11b0 100644 --- a/modules/ns/Hash.h +++ b/modules/ns/Hash.h @@ -164,7 +164,7 @@ public: { if (hashbucket->at(i) == hash) { - if (key.compare(keybucket->at(i).chars()) == 0) + if (key.compare(keybucket->at(i)) == 0) { return &(m_DataBuckets[bucketnum].at(i)); }