Core/Spells: Spell id being cast by player can now be changed depending on map difficulty

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-01 14:12:08 +01:00
parent 445dc511f3
commit 4e0735196e

View File

@@ -1057,10 +1057,10 @@ class SpellMgr
SpellEntry const* GetSpellForDifficultyFromSpell(SpellEntry const* spell, Unit* Caster)
{
//spell never can be NULL in this case!
if (!Caster->ToCreature() || !Caster->ToCreature()->GetMap() || !Caster->ToCreature()->GetMap()->IsDungeon())
if (!Caster || !Caster->GetMap() || !Caster->GetMap()->IsDungeon())
return spell;
uint32 mode = uint32(Caster->ToCreature()->GetMap()->GetSpawnMode());
uint32 mode = uint32(Caster->GetMap()->GetSpawnMode());
if (mode >= MAX_DIFFICULTY)
{
sLog.outError("GetSpellForDifficultyFromSpell: Incorrect Difficulty for spell %u.", spell->Id);