[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

@ -1736,8 +1736,8 @@ void Group::_homebindIfInstance(Player *player)
{
// leaving the group in an instance, the homebind timer is started
// unless the player is permanently saved to the instance
InstanceSave *save = sInstanceSaveMgr.GetInstanceSave(player->GetInstanceId());
InstancePlayerBind *playerBind = save ? player->GetBoundInstance(save->GetMapId(), save->GetDifficulty()) : NULL;
Map* map = player->GetMap();
InstancePlayerBind *playerBind = map->IsDungeon() ? player->GetBoundInstance(map->GetId(), map->GetDifficulty()) : NULL;
if(!playerBind || !playerBind->perm)
player->m_InstanceValid = false;
}