From d05c34b73cf65286942f5b8f3205dddec62b8578 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 7 Jun 2006 05:21:03 +0000 Subject: [PATCH] fixed a bug causing failed modules to register as successes. this also blocked handlers from being called. --- amxmodx/modules.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index 422be5d2..b65eed11 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -478,10 +478,15 @@ int CheckModules(AMX *amx, char error[128]) if (!found) { - if ((expect != LibType_Library) || !LoadModule(buffer, PT_ANYTIME)) + if (expect == LibType_Library) { - if (pHandler->HandleModule(buffer, (expect == LibType_Class))) + if (!LoadModule(buffer, PT_ANYTIME)) + { + if (pHandler->HandleModule(buffer, (expect == LibType_Class))) + found = true; + } else { found = true; + } } } @@ -914,6 +919,8 @@ bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool no cc->queryModule(); + bool error = true; + switch (cc->getStatusValue()) { case MODULE_BADLOAD: @@ -940,10 +947,18 @@ bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool no case MODULE_NOT64BIT: report_error(1, "[AMXX] Module \"%s\" is not 64 bit compatible.", path.c_str()); break; + default: + error = false; + break; } g_modules.put(cc); + if (error) + { + return false; + } + if (cc->IsMetamod()) { char *mmpathname = build_pathname_addons(