Fail to load a metamod-enabled extension if it refuses to attach to MM:S (bug 5042, r=dvander).

This commit is contained in:
Asher Baker 2011-08-15 19:30:56 +01:00
parent 1bd97730ce
commit 05e5c93e91

View File

@ -182,6 +182,16 @@ bool CLocalExtension::Load(char *error, size_t maxlength)
{
bool already;
m_PlId = g_pMMPlugins->Load(m_Path.c_str(), g_PLID, already, error, maxlength);
// Check the plugin didn't refuse load
Pl_Status status;
if (!m_PlId || (g_pMMPlugins->Query(m_PlId, NULL, &status, NULL) && status < Pl_Paused))
{
m_pLib->CloseLibrary();
m_pLib = NULL;
m_pAPI = NULL;
return false;
}
}
if (!CExtension::Load(error, maxlength))