[11608] Check correct map for enter at far teleport

Not fatal porblem, but let correctly work check for avoid teleport back at teleport fail.
This commit is contained in:
VladimirMangos 2011-06-05 21:43:31 +04:00
parent f99476cad5
commit 44d168d4a3
2 changed files with 3 additions and 2 deletions

View file

@ -1822,7 +1822,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// If the map is not created, assume it is possible to enter it.
// It will be created in the WorldPortAck.
Map *map = sMapMgr.FindMap(mapid);
DungeonPersistentState* state = GetBoundInstanceSaveForSelfOrGroup(mapid);
Map *map = sMapMgr.FindMap(mapid, state ? state->GetInstanceId() : 0);
if (!map || map->CanEnter(this))
{
//lets reset near teleport flag if it wasn't reset during chained teleports