Skip to content

Commit

Permalink
[9593] Fixed bug in instance binding in case heroic/25-man raids diff…
Browse files Browse the repository at this point in the history
…iculties

In fact typo in my old commit at adding support MapDifficulty.dbc.
  • Loading branch information
VladimirMangos committed Mar 16, 2010
1 parent 96f1a2d commit b5a46f1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/game/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,11 +1644,8 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player)
return NULL;
}

InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
InstanceGroupBind* Group::GetBoundInstance(Map* aMap, Difficulty difficulty)
{
// Currently spawn numbering not different from map difficulty
Difficulty difficulty = GetDifficulty(aMap->IsRaid());

// some instances only have one difficulty
MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty);
if(!mapDiff)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class MANGOS_DLL_SPEC Group
InstanceGroupBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false);
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
InstanceGroupBind* GetBoundInstance(Player* player);
InstanceGroupBind* GetBoundInstance(Map* aMap);
InstanceGroupBind* GetBoundInstance(Map* aMap, Difficulty difficulty);
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/game/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ bool InstanceMap::Add(Player *player)
if(pGroup)
{
// solo saves should be reset when entering a group
InstanceGroupBind *groupBind = pGroup->GetBoundInstance(this);
InstanceGroupBind *groupBind = pGroup->GetBoundInstance(this,GetDifficulty());
if(playerBind)
{
sLog.outError("InstanceMap::Add: player %s(%d) is being put in instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
Expand Down
2 changes: 1 addition & 1 deletion src/game/MapInstanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
InstanceGroupBind *groupBind = NULL;
Group *group = player->GetGroup();
// 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(this,player->GetDifficulty(IsRaid()))))
pSave = groupBind->save;
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9592"
#define REVISION_NR "9593"
#endif // __REVISION_NR_H__

0 comments on commit b5a46f1

Please sign in to comment.