mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user