Core/Spells: Fixed a crash when npc casts a spell with SpellLevel = 0 and SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION attribute

Closes #16072
This commit is contained in:
Shauren
2015-12-20 12:44:14 +01:00
parent 67c57c4b5b
commit ef91ba9517
2 changed files with 3 additions and 3 deletions

View File

@@ -109,8 +109,8 @@ public:
T const* EvaluateTable(uint32 row, uint32 column) const
{
ASSERT(row < _gtEntry->NumRows);
ASSERT(column < _gtEntry->NumColumns);
ASSERT(row < _gtEntry->NumRows, "Requested row %u from GameTable %s but there are only %u rows!", row, _gtEntry->Name->Str[0], _gtEntry->NumRows);
ASSERT(column < _gtEntry->NumColumns, "Requested column %u from GameTable %s but there are only %u columns!", column, _gtEntry->Name->Str[0], _gtEntry->NumColumns);
return _storage.LookupEntry(_gtEntry->NumRows * column + row);
}

View File

@@ -2666,7 +2666,7 @@ std::vector<SpellInfo::CostData> SpellInfo::CalcPowerCost(Unit const* caster, Sp
modOwner->ApplySpellMod(Id, SPELLMOD_SPELL_COST2, powerCost);
}
if (!caster->IsControlledByPlayer() && G3D::fuzzyEq(power->ManaCostPercentage, 0.0f))
if (!caster->IsControlledByPlayer() && G3D::fuzzyEq(power->ManaCostPercentage, 0.0f) && SpellLevel)
{
if (Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION)
{