diff options
author | megamage <none@none> | 2009-01-03 10:54:51 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-03 10:54:51 -0600 |
commit | 89fb5ffcd6c6dcf194a957766a37c3fa7b246153 (patch) | |
tree | 0b40788271639c4eb56871673e53a865687c7fd0 /src/game/ObjectMgr.cpp | |
parent | 5d4f8968aefe17794a0349c61935420910b58c2e (diff) |
*Mangos [7010] Teleport players to the entrance of instances if they are in reset ones at login. By arrai.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 65ccbf583de..da79a656db2 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5287,6 +5287,9 @@ void ObjectMgr::LoadAreaTriggerTeleports() sLog.outString( ">> Loaded %u area trigger teleport definitions", count ); } +/* + * Searches for the areatrigger which teleports players out of the given map + */ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const { const MapEntry *mapEntry = sMapStore.LookupEntry(Map); @@ -5303,6 +5306,23 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const return NULL; } +/** + * Searches for the areatrigger which teleports players to the given map + */ +AreaTrigger const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const +{ + for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); ++itr) + { + if(itr->second.target_mapId == Map) + { + AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); + if(atEntry) + return &itr->second; + } + } + return NULL; +} + void ObjectMgr::SetHighestGuids() { QueryResult *result = CharacterDatabase.Query( "SELECT MAX(guid) FROM characters" ); |