Merge a60331d10985181da97d580ad2d35000b933542d into f6c4164765afe447476114e632ee3d70b04a1777

This commit is contained in:
Anton Popovichenko 2025-02-20 06:30:42 +01:00 committed by GitHub
commit 3279a84a00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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))