diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-12-20 12:44:14 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-12-20 12:44:14 +0100 |
commit | ef91ba951744d9e095cd03ba4f80f5aa49bcdb32 (patch) | |
tree | bba1ff52447c6a36ec2b4a1f0451a284370f9c7a /src | |
parent | 67c57c4b5be0c068f236c647fecd1ebf7f612d04 (diff) |
Core/Spells: Fixed a crash when npc casts a spell with SpellLevel = 0 and SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION attribute
Closes #16072
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DataStores/DBCStores.h | 4 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 63cff4a4fea..baea702a04a 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -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); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index baf251bc31b..94aedadce29 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -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) { |