[10123] Fixed recent problem with enter to dungeons in group.

Problem related to implicit get map id from player in Group::GetBoundInstance
when in some cases check done before player mapid update.
This commit is contained in:
VladimirMangos 2010-06-30 00:43:46 +04:00
parent 15390df4d9
commit 41f8cfb14c
5 changed files with 6 additions and 7 deletions

View file

@ -1122,7 +1122,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
else else
player->SetGroup(this, group); player->SetGroup(this, group);
// if the same group invites the player back, cancel the homebind timer // if the same group invites the player back, cancel the homebind timer
InstanceGroupBind *bind = GetBoundInstance(player); InstanceGroupBind *bind = GetBoundInstance(player->GetMapId(), player);
if(bind && bind->save->GetInstanceId() == player->GetInstanceId()) if(bind && bind->save->GetInstanceId() == player->GetInstanceId())
player->m_InstanceValid = true; player->m_InstanceValid = true;
} }
@ -1651,9 +1651,8 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
} }
} }
InstanceGroupBind* Group::GetBoundInstance(Player* player) InstanceGroupBind* Group::GetBoundInstance(uint32 mapid, Player* player)
{ {
uint32 mapid = player->GetMapId();
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid); MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
if(!mapEntry) if(!mapEntry)
return NULL; return NULL;

View file

@ -354,7 +354,7 @@ class MANGOS_DLL_SPEC Group
InstanceGroupBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false); InstanceGroupBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false);
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false); void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
InstanceGroupBind* GetBoundInstance(Player* player); InstanceGroupBind* GetBoundInstance(uint32 mapId, Player* player);
InstanceGroupBind* GetBoundInstance(Map* aMap, Difficulty difficulty); InstanceGroupBind* GetBoundInstance(Map* aMap, Difficulty difficulty);
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; } BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }

View file

@ -549,7 +549,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
{ {
Group *group = _player->GetGroup(); Group *group = _player->GetGroup();
// if no bind exists, create a solo bind // if no bind exists, create a solo bind
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; InstanceGroupBind *gBind = group ? group->GetBoundInstance(target->GetMapId(), target) : NULL;
// if no bind exists, create a solo bind // if no bind exists, create a solo bind
if (!gBind) if (!gBind)
if (InstanceSave *save = target->GetMap()->GetInstanceSave()) if (InstanceSave *save = target->GetMap()->GetInstanceSave())

View file

@ -16439,7 +16439,7 @@ InstanceSave* Player::GetBoundInstanceSaveForSelfOrGroup(uint32 mapid)
InstanceGroupBind *groupBind = NULL; InstanceGroupBind *groupBind = NULL;
Group *group = GetGroup(); Group *group = GetGroup();
// use the player's difficulty setting (it may not be the same as the group's) // use the player's difficulty setting (it may not be the same as the group's)
if(group && (groupBind = group->GetBoundInstance(this))) if(group && (groupBind = group->GetBoundInstance(mapid, this)))
pSave = groupBind->save; pSave = groupBind->save;
} }

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 "10122" #define REVISION_NR "10123"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__