implemented request amb302 (onservercfg and onmapstart are now called if a plugin is late loaded)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40854
This commit is contained in:
David Anderson
2007-05-23 17:54:45 +00:00
parent c9353c7a2f
commit 196a665d51
6 changed files with 29 additions and 2 deletions
+17
View File
@@ -25,6 +25,8 @@
#include "ExtensionSys.h"
#include "sm_srvcmds.h"
#include "sm_stringutil.h"
#include "ConCmdManager.h"
#include "PlayerManager.h"
CPluginManager g_PluginSys;
HandleType_t g_PluginType = 0;
@@ -299,6 +301,21 @@ void CPlugin::Call_OnPluginStart()
if ((err=pFunction->Execute(&result)) != SP_ERROR_NONE)
{
SetErrorState(Plugin_Error, "Error detected in plugin startup (see error logs)");
} else {
if (g_OnMapStarted)
{
if ((pFunction = m_ctx.base->GetFunctionByName("OnMapStart")) != NULL)
{
pFunction->Execute(NULL);
}
}
if (g_ConCmds.IsServerCfgDone())
{
if ((pFunction = m_ctx.base->GetFunctionByName("OnServerCfg")) != NULL)
{
pFunction->Execute(NULL);
}
}
}
}