diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e20def2cb..11ca29a07 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1431,7 +1431,16 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici float destx = pos.GetPositionX() + distance * cos(pos.GetOrientation()); float desty = pos.GetPositionY() + distance * sin(pos.GetOrientation()); - float ground = map->GetHeight(phasemask, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); + // Added GROUND_HEIGHT_TOLERANCE to account for cases where, during a jump, + // the Z position may be slightly below the vmap ground level. + // Without this tolerance, a ray trace might incorrectly attempt to find ground + // beneath the actual surface. + // + // Example: + // actual vmap ground: -56.342392 + // Z position: -56.347195 + float searchGroundZPos = pos.GetPositionZ()+GROUND_HEIGHT_TOLERANCE; + float ground = map->GetHeight(phasemask, pos.GetPositionX(), pos.GetPositionY(), searchGroundZPos); bool isCasterInWater = m_caster->IsInWater(); if (!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || (pos.GetPositionZ() - ground < distance))