[10114] Store associated InstanceSave for dungeon map in Map object

This commit is contained in:
VladimirMangos 2010-06-27 21:01:29 +04:00
parent 6f4481a591
commit 67a7892075
9 changed files with 89 additions and 62 deletions

View file

@ -15213,12 +15213,14 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
}
}
// NOW player must have valid map
// player bounded instance saves loaded in _LoadBoundInstances, group versions at group loading
InstanceSave* instanceSave = GetBoundInstanceSaveForSelfOrGroup(GetMapId());
// load the player's map here if it's not already loaded
SetMap(sMapMgr.CreateMap(GetMapId(), this));
// if the player is in an instance and it has been reset in the meantime teleport him to the entrance
if(GetInstanceId() && !sInstanceSaveMgr.GetInstanceSave(GetInstanceId()))
if(GetInstanceId() && !instanceSave)
{
AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(GetMapId());
if(at)