1
0

Added a HOOK_WORLD_STARTED hook and a cRoot::CreateAndInitializeWorld function for plugins.

This commit is contained in:
STRWarrior
2013-12-11 12:39:13 +01:00
parent 9cfd8f6910
commit 12bd5082b8
9 changed files with 98 additions and 2 deletions

View File

@@ -1143,6 +1143,21 @@ bool cPluginLua::OnWeatherChanging(cWorld & a_World, eWeather & a_NewWeather)
bool cPluginLua::OnWorldStarted(cWorld & a_World)
{
cCSLock Lock(m_CriticalSection);
cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_WORLD_STARTED];
for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
{
m_LuaState.Call((int)(**itr), &a_World);
}
return false;
}
bool cPluginLua::OnWorldTick(cWorld & a_World, float a_Dt, int a_LastTickDurationMSec)
{
cCSLock Lock(m_CriticalSection);