Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)

Core/Spells: Fix wrong distance calculations in AoE spells.
Pull request #16290 by chaodhib.
God bless, finally.

(cherry picked from commit a1f2f30c145f6ad9c4baeffeff32618e71ff537c)
This commit is contained in:
Chaouki Dhib authored and funjoker committed 2022-02-16 04:49:24 +01:00
1 parent 4ad1d377fe
commit 17c4d8f6d9
11 files changed
+123 -46

No files matched your search

+29
View File
@@ -74,6 +74,35 @@ bool SpellImplicitTargetInfo::IsArea() const
return GetSelectionCategory() == TARGET_SELECT_CATEGORY_AREA || GetSelectionCategory() == TARGET_SELECT_CATEGORY_CONE;
}
bool SpellImplicitTargetInfo::IsProximityBasedAoe() const
{
switch (_target)
{
case TARGET_UNIT_SRC_AREA_ENTRY:
case TARGET_UNIT_SRC_AREA_ENEMY:
case TARGET_UNIT_CASTER_AREA_PARTY:
case TARGET_UNIT_SRC_AREA_ALLY:
case TARGET_UNIT_SRC_AREA_PARTY:
case TARGET_UNIT_LASTTARGET_AREA_PARTY:
case TARGET_GAMEOBJECT_SRC_AREA:
case TARGET_UNIT_CASTER_AREA_RAID:
case TARGET_CORPSE_SRC_AREA_ENEMY:
return true;
case TARGET_UNIT_DEST_AREA_ENTRY:
case TARGET_UNIT_DEST_AREA_ENEMY:
case TARGET_UNIT_DEST_AREA_ALLY:
case TARGET_UNIT_DEST_AREA_PARTY:
case TARGET_GAMEOBJECT_DEST_AREA:
case TARGET_UNIT_TARGET_AREA_RAID_CLASS:
return false;
default:
TC_LOG_WARN("spells", "SpellImplicitTargetInfo::IsProximityBasedAoe called a non-aoe spell");
return false;
}
}
SpellTargetSelectionCategories SpellImplicitTargetInfo::GetSelectionCategory() const
{
return _data[_target].SelectionCategory;