[8252] Move DB scripting code from global World to Map. Author: Ambal

This one more step to pre-map events proccesing and parallel in future.

    [8256] Restore DB script loading broken after [8252]. Author: VladimirMangos

    Also propetly decrease scheduled DB script actions at map unloading.
    Some code style restore.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-31 10:48:34 +08:00
parent b1bd5e7905
commit 0a2af88cb4
10 changed files with 921 additions and 892 deletions

View File

@@ -949,7 +949,7 @@ void GameObject::Use(Unit* user)
UseDoorOrButton();
// activate script
sWorld.ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this);
GetMap()->ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this);
return;
case GAMEOBJECT_TYPE_QUESTGIVER: //2
@@ -1045,7 +1045,7 @@ void GameObject::Use(Unit* user)
player->CastedCreatureOrGO(info->id, GetGUID(), 0);
if (info->goober.eventId)
sWorld.ScriptsStart(sEventScripts, info->goober.eventId, player, this);
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
}
// cast this spell later if provided
@@ -1068,7 +1068,7 @@ void GameObject::Use(Unit* user)
player->SendCinematicStart(info->camera.cinematicId);
if (info->camera.eventID)
sWorld.ScriptsStart(sEventScripts, info->camera.eventID, player, this);
GetMap()->ScriptsStart(sEventScripts, info->camera.eventID, player, this);
return;
}