Extend Deeprun Tram portal trigger range to bypass WMO collision walls
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

This commit is contained in:
Kelsi 2026-03-05 21:17:45 -08:00
parent d763d71bf3
commit cefb05c027

View file

@ -8809,13 +8809,21 @@ void GameHandler::checkAreaTriggers() {
areaTriggerSuppressFirst_ = false;
}
// Deeprun Tram entrance triggers need extended range because WMO
// collision walls block the player from reaching the trigger center.
static const std::unordered_set<uint32_t> extendedRangeTriggers = {
712, 713, // Stormwind/Ironforge → Deeprun Tram
2166, 2171, // Tram interior exit triggers
};
for (const auto& at : areaTriggers_) {
if (at.mapId != currentMapId_) continue;
const bool extended = extendedRangeTriggers.count(at.id) > 0;
bool inside = false;
if (at.radius > 0.0f) {
// Sphere trigger — small minimum so player must be near the portal
float effectiveRadius = std::max(at.radius, 12.0f);
float effectiveRadius = std::max(at.radius, extended ? 45.0f : 12.0f);
float dx = px - at.x;
float dy = py - at.y;
float dz = pz - at.z;
@ -8823,9 +8831,10 @@ void GameHandler::checkAreaTriggers() {
inside = (distSq <= effectiveRadius * effectiveRadius);
} else if (at.boxLength > 0.0f || at.boxWidth > 0.0f || at.boxHeight > 0.0f) {
// Box trigger — small minimum so player must walk into the portal area
float effLength = std::max(at.boxLength, 16.0f);
float effWidth = std::max(at.boxWidth, 16.0f);
float effHeight = std::max(at.boxHeight, 16.0f);
float boxMin = extended ? 60.0f : 16.0f;
float effLength = std::max(at.boxLength, boxMin);
float effWidth = std::max(at.boxWidth, boxMin);
float effHeight = std::max(at.boxHeight, boxMin);
float dx = px - at.x;
float dy = py - at.y;