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

+6 -1
View File
@@ -1364,6 +1364,11 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
radius = m_spellInfo->GetMaxRange(m_spellInfo->IsPositiveEffect(effIndex), m_caster, this);
radius *= m_spellValue->RadiusMod;
// if this is a proximity based aoe (Frost Nova, Psychic Scream, ...), include the caster's own combat reach
if (targetType.IsProximityBasedAoe())
radius += GetCaster()->GetCombatReach();
std::list<WorldObject*> targets;
switch (targetType.GetTarget())
{
@@ -1448,7 +1453,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
float dist = frand(minDist, maxDist);
float x, y, z;
float angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dist, angle);
m_caster->GetClosePoint(x, y, z, DEFAULT_PLAYER_BOUNDING_RADIUS, dist, angle);
float ground = m_caster->GetMapHeight(x, y, z);
float liquidLevel = VMAP_INVALID_HEIGHT_VALUE;