        }

        // Clamp absurd heights (blocked mask 127 => 12.7f, desync after warp, etc.)
        // Keeps mounts/flight usable without false snaps: flying skins get a higher budget.
        {
            float terrainH = ((1.0f - fProgressRate) * fCurrent) + (float)(fNext * fProgressRate);
            // Attribute CantGo paints mask as 127; never treat that as standing height.
            if (terrainH >= 12.5f)
            {
                float meshH = pScene->GroundGetHeight(m_vecPosition);
                if (meshH > -999.0f)
                    terrainH = meshH;
                else
                    terrainH = (m_fHeight < 12.5f) ? m_fHeight : 0.0f;
            }

            const bool flyingLike =
                m_nSkinMeshType == 40 || m_nSkinMeshType == 20 || m_nSkinMeshType == 39 || m_nSkinMeshType == 8
                || (m_cMount && (m_nMountSkinMeshType == 40 || m_nMountSkinMeshType == 20
                    || m_nMountSkinMeshType == 39 || m_nMountSkinMeshType == 45
                    || m_nMountSkinMeshType == 46 || m_nMountSkinMeshType == 47));

            float maxAbove = flyingLike ? 8.0f : 3.5f;
            // Spider mount (59) is ground-based; keep a small visual budget only.
            if (m_cMount && m_nMountSkinMeshType == 59)
                maxAbove = 2.5f;

            if (m_fWantHeight > terrainH + maxAbove)
                m_fWantHeight = terrainH + (flyingLike ? 1.5f : (m_cMount ? 0.8f : 0.0f));
            if (m_fWantHeight < terrainH - 2.0f && !flyingLike)
                m_fWantHeight = terrainH;
        }
    }

    if (!m_bIgnoreHeight)
        m_fHeight = GetMyHeight();

    if (m_bIgnoreHeight)
        SetPosition(m_vecPosition.x + m_vecAirMove.x, m_fHeight, m_vecPosition.y + m_vecAirMove.y);
    else
        SetPosition(m_vecPosition.x, m_fHeight, m_vecPosition.y);
