diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 99b12743237..111de39a194 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4813,26 +4813,9 @@ void ObjectMgr::LoadEventScripts() // Load all possible script entries from gameobjects for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i) { - GameObjectInfo const * goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i); - if (goInfo) - { - switch(goInfo->type) - { - case GAMEOBJECT_TYPE_GOOBER: - if (goInfo->goober.eventId) - evt_scripts.insert(goInfo->goober.eventId); - break; - case GAMEOBJECT_TYPE_CHEST: - if (goInfo->chest.eventId) - evt_scripts.insert(goInfo->chest.eventId); - break; - case GAMEOBJECT_TYPE_CAMERA: - if (goInfo->camera.eventID) - evt_scripts.insert(goInfo->camera.eventID); - default: - break; - } - } + if (GameObjectInfo const * goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i)) + if (uint32 eventId = goInfo->GetEventScriptId()) + evt_scripts.insert(eventId); } // Load all possible script entries from spells for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) @@ -4851,6 +4834,20 @@ void ObjectMgr::LoadEventScripts() } } + for(size_t path_idx = 0; path_idx < sTaxiPathNodesByPath.size(); ++path_idx) + { + for(size_t node_idx = 0; node_idx < sTaxiPathNodesByPath[path_idx].size(); ++node_idx) + { + TaxiPathNodeEntry const& node = sTaxiPathNodesByPath[path_idx][node_idx]; + + if (node.arrivalEventID) + evt_scripts.insert(node.arrivalEventID); + + if (node.departureEventID) + evt_scripts.insert(node.departureEventID); + } + } + // Then check if all scripts are in above list of possible script entries for (ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr) { |