mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7010] Teleport players to the entrance of instances if they are in reset ones at login
This commit is contained in:
parent
c88dfbccb3
commit
88208bc9a7
5 changed files with 36 additions and 3 deletions
|
|
@ -5127,6 +5127,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);
|
||||
|
|
@ -5143,6 +5146,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" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue