fix(Core/Player): dismount flying mounts entering strict no-fly zones#26430
fix(Core/Player): dismount flying mounts entering strict no-fly zones#26430Chinoske wants to merge 1 commit into
Conversation
Player::UpdateAreaDependentAuras() intentionally checks area-limited auras with CheckLocation(strict=false), which skips the AREA_FLAG_NO_FLY_ZONE check so unrelated area-limited auras aren't dropped over a technicality. That means a flying mount already active (e.g. cast before entering, or restored on reconnect) is never re-validated against a zone's no-fly flag, since IsFlyable() alone doesn't catch it (Dalaran is flyable terrain but explicitly flagged no-fly). Add a dedicated strict re-check for SPELL_AURA_MOUNTED right after the existing lenient loop: remove the mount and clear CanFly() if it fails strict CheckLocation, and cast the same Parachute safe-descent spell already used when a flying vehicle passenger is force-ejected (Vehicle::RemovePassenger), so the forced dismount doesn't cause fall damage. Runs on the continuous per-area-update path, so it applies regardless of how the player got into the no-fly zone while mounted (normal flight, GM cast, or any login/reconnect path). Fixes azerothcore#26346
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a revalidation step for mount auras in Player::UpdateAreaDependentAuras. The mount spell's location is checked against the current map/zone/area, and if invalid, the mount aura is removed; if the player was flying, flight is disabled and a parachute spell is cast to force descent. ChangesMount Aura Area Revalidation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Root cause
Closes #26346
Player::UpdateAreaDependentAuras()checks area-limited auras viaSpellInfo::CheckLocation(..., strict=false).strict=falsedeliberately skips theAREA_FLAG_NO_FLY_ZONEcheck, so other area-limited auras aren't dropped over a technicality — but it also means a flying mount already active (cast before entering a no-fly zone, or still active on reconnect/relogin) is never re-validated against that flag.IsFlyable()alone doesn't catch it either, since Dalaran is flyable terrain that's additionally flagged as a no-fly zone.Symptom reported in #26346: a player flying a mount over Dalaran who closes the client and reconnects (especially a fast reconnect, which reuses the live in-memory
Playerobject and skips a full DB reload) ends up stuck flying with no mount, since nothing ever re-validates the mount against the zone.Fix
Added a dedicated strict re-check for
SPELL_AURA_MOUNTEDright after the existing lenient loop inUpdateAreaDependentAuras():CanFly()if strictCheckLocationfails.VEHICLE_SPELL_PARACHUTEsafe-descent spell AzerothCore already uses when a flying vehicle passenger is force-ejected mid-air (Vehicle::RemovePassenger), so the forced dismount doesn't cause fall damage.Since
UpdateAreaDependentAuras()runs on every area change (not just login), this fixes the bug at its actual source instead of patching individual login code paths: a flying mount now gets stripped the instant it's active in a strict no-fly zone's airspace, regardless of how the player got there (normal flight, GM.cast, or any login/reconnect path). The invalid "flying mounted in a no-fly zone" state can no longer persist even momentarily, so there's nothing left to break on a subsequent disconnect/reconnect.How Has This Been Tested?
Local RelWithDebInfo build, live server testing:
.cast 32239(Ebon Gryphon) while standing in Dalaran (Krasus' Landing) — mount is immediately removed,CanFlycleared, safe parachute descent (no fall damage).Types of changes
Checklist