fixed a bug causing failed modules to register as successes. this also blocked handlers from being called.

This commit is contained in:
David Anderson 2006-06-07 05:21:03 +00:00
parent c69777d8cc
commit d05c34b73c

View File

@ -478,10 +478,15 @@ int CheckModules(AMX *amx, char error[128])
if (!found) if (!found)
{ {
if ((expect != LibType_Library) || !LoadModule(buffer, PT_ANYTIME)) if (expect == LibType_Library)
{
if (!LoadModule(buffer, PT_ANYTIME))
{ {
if (pHandler->HandleModule(buffer, (expect == LibType_Class))) if (pHandler->HandleModule(buffer, (expect == LibType_Class)))
found = true; found = true;
} else {
found = true;
}
} }
} }
@ -914,6 +919,8 @@ bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool no
cc->queryModule(); cc->queryModule();
bool error = true;
switch (cc->getStatusValue()) switch (cc->getStatusValue())
{ {
case MODULE_BADLOAD: case MODULE_BADLOAD:
@ -940,10 +947,18 @@ bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool no
case MODULE_NOT64BIT: case MODULE_NOT64BIT:
report_error(1, "[AMXX] Module \"%s\" is not 64 bit compatible.", path.c_str()); report_error(1, "[AMXX] Module \"%s\" is not 64 bit compatible.", path.c_str());
break; break;
default:
error = false;
break;
} }
g_modules.put(cc); g_modules.put(cc);
if (error)
{
return false;
}
if (cc->IsMetamod()) if (cc->IsMetamod())
{ {
char *mmpathname = build_pathname_addons( char *mmpathname = build_pathname_addons(