fix(Core/Spell): Prevent Blink from causing character to fall through ground (#21537)

This commit is contained in:
Anton Popovichenko
2025-03-19 17:46:00 +01:00
committed by GitHub
parent 5eee6bc383
commit 9520b25155

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