Merge a60331d10985181da97d580ad2d35000b933542d into 880804d6fab7b0f9375810891279cc64a61f91dd

This commit is contained in:
Anton Popovichenko 2025-02-21 09:56:52 +03:00 committed by GitHub
commit b28cc06ee0
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))