From 211b50ce63d2466ab4b5716aa3703d3053148f51 Mon Sep 17 00:00:00 2001 From: laise Date: Wed, 21 Oct 2009 22:46:40 +0400 Subject: [PATCH] [8699] Fix instance bound difficulty selection. This must fix crashes at enter to heroic mode instances and raids showup after client switch. Signed-off-by: VladimirMangos I can't repeat crashes with existed raids after changes apply but possible in some cases need drop content of related DB table for resolve some crashes. --- src/game/Group.cpp | 2 +- src/game/MapInstanced.cpp | 4 +++- src/shared/revision_nr.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index b3f77f529..48aa5ec3d 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1596,7 +1596,7 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player) InstanceGroupBind* Group::GetBoundInstance(Map* aMap) { // Currently spawn numbering not different from map difficulty - Difficulty difficulty = Difficulty(aMap->GetSpawnMode()); + Difficulty difficulty = GetDifficulty(aMap->IsRaid()); // some instances only have one difficulty MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty); diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 0aa985ffe..1455adf7e 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -167,7 +167,9 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player) // if no instanceId via group members or instance saves is found // the instance will be created for the first time NewInstanceId = MapManager::Instance().GenerateInstanceId(); - map = CreateInstance(NewInstanceId, NULL, player->GetDifficulty(IsRaid())); + + Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); + map = CreateInstance(NewInstanceId, NULL, diff); } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 102e0af34..520f42ada 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8698" + #define REVISION_NR "8699" #endif // __REVISION_NR_H__