[11610] Select proper spell difficulty subtitution.

Fix mostly affect cases when absent 25-man difficulties spell version.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
PSZ 2011-06-05 21:49:51 +04:00 committed by VladimirMangos
parent 753b0cd969
commit 3a60c4ae3b
4 changed files with 10 additions and 8 deletions

View file

@ -4496,16 +4496,18 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return true;
}
SpellEntry const* GetSpellEntryByDifficulty(uint32 id, Difficulty difficulty)
SpellEntry const* GetSpellEntryByDifficulty(uint32 id, Difficulty difficulty, bool isRaid)
{
SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(id);
if (!spellDiff)
return NULL;
if (!spellDiff->spellId[difficulty])
return NULL;
for (Difficulty diff = difficulty; diff >= REGULAR_DIFFICULTY; diff = GetPrevDifficulty(diff, isRaid))
{
if (spellDiff->spellId[diff])
return sSpellStore.LookupEntry(spellDiff->spellId[difficulty]);
}
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellDiff->spellId[difficulty]);
return spellEntry;
return NULL;
}