[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 <vladimir@getmangos.com>

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.
This commit is contained in:
laise 2009-10-21 22:46:40 +04:00 committed by VladimirMangos
parent 97c94cff56
commit 211b50ce63
3 changed files with 5 additions and 3 deletions

View file

@ -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);

View file

@ -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);
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8698"
#define REVISION_NR "8699"
#endif // __REVISION_NR_H__