* Added new World::OnStartup/OnShutdown hooks.
--HG-- branch : trunk
This commit is contained in:
@@ -1012,6 +1012,16 @@ void ScriptMgr::OnRelocate(Transport* transport, uint32 mapId, float x, float y,
|
||||
tmpscript->OnRelocate(transport, mapId, x, y, z);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnStartup()
|
||||
{
|
||||
FOREACH_SCRIPT(WorldScript)->OnStartup();
|
||||
}
|
||||
|
||||
void ScriptMgr::OnShutdown()
|
||||
{
|
||||
FOREACH_SCRIPT(WorldScript)->OnShutdown();
|
||||
}
|
||||
|
||||
void SpellHandlerScript::RegisterSelf()
|
||||
{
|
||||
ScriptMgr::ScriptRegistry<SpellHandlerScript>::AddScript(this);
|
||||
|
||||
@@ -292,6 +292,12 @@ class WorldScript : public ScriptObject, public UpdatableScript<void>
|
||||
|
||||
// Called on every world tick (don't execute too heavy code here).
|
||||
virtual void OnUpdate(void* null, uint32 diff) { }
|
||||
|
||||
// Called when the world is started.
|
||||
virtual void OnStartup() { }
|
||||
|
||||
// Called when the world is actually shut down.
|
||||
virtual void OnShutdown() { }
|
||||
};
|
||||
|
||||
class FormulaScript : public ScriptObject
|
||||
@@ -787,6 +793,8 @@ class ScriptMgr
|
||||
void OnShutdownInitiate(ShutdownExitCode code, ShutdownMask mask);
|
||||
void OnShutdownCancel();
|
||||
void OnWorldUpdate(uint32 diff);
|
||||
void OnStartup();
|
||||
void OnShutdown();
|
||||
|
||||
public: /* FormulaScript */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user