Global forwards created after all plugins have been loaded now properly get filled with IPluginFunction pointers.
Added CPluginManager::AddFunctionsToForward() to help do this... --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40617
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "ShareSys.h"
|
||||
#include "LibrarySys.h"
|
||||
#include "HandleSys.h"
|
||||
#include "ForwardSys.h"
|
||||
#include "sourcemm_api.h"
|
||||
#include "sourcemod.h"
|
||||
#include "TextParsers.h"
|
||||
@@ -1879,3 +1880,25 @@ bool CPluginManager::AddFakeNative(IPluginFunction *pFunction, const char *name,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPluginManager::AddFunctionsToForward(const char *name, IChangeableForward *pForward)
|
||||
{
|
||||
List<CPlugin *>::iterator iter;
|
||||
CPlugin *pPlugin;
|
||||
IPluginFunction *pFunction;
|
||||
|
||||
for (iter = m_plugins.begin(); iter != m_plugins.end(); iter++)
|
||||
{
|
||||
pPlugin = (*iter);
|
||||
|
||||
if (pPlugin->GetStatus() <= Plugin_Paused)
|
||||
{
|
||||
pFunction = pPlugin->GetBaseContext()->GetFunctionByName(name);
|
||||
|
||||
if (pFunction)
|
||||
{
|
||||
pForward->AddFunction(pFunction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user