[10132] Cleanup code for Group::_homebindIfInstance

This commit is contained in:
VladimirMangos 2010-07-02 03:19:50 +04:00
parent 8d80906296
commit 885c3449b4
2 changed files with 10 additions and 7 deletions

View file

@ -1731,14 +1731,17 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload)
void Group::_homebindIfInstance(Player *player) void Group::_homebindIfInstance(Player *player)
{ {
if(player && !player->isGameMaster() && sMapStore.LookupEntry(player->GetMapId())->IsDungeon()) if (player && !player->isGameMaster())
{ {
// leaving the group in an instance, the homebind timer is started
// unless the player is permanently saved to the instance
Map* map = player->GetMap(); Map* map = player->GetMap();
InstancePlayerBind *playerBind = map->IsDungeon() ? player->GetBoundInstance(map->GetId(), map->GetDifficulty()) : NULL; if (map->IsDungeon())
if(!playerBind || !playerBind->perm) {
player->m_InstanceValid = false; // leaving the group in an instance, the homebind timer is started
// unless the player is permanently saved to the instance
InstancePlayerBind *playerBind = player->GetBoundInstance(map->GetId(), map->GetDifficulty());
if(!playerBind || !playerBind->perm)
player->m_InstanceValid = false;
}
} }
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10131" #define REVISION_NR "10132"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__