mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Reduce instance portal area trigger range to prevent premature teleports
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
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:
parent
16d44c5bb3
commit
16daa2baf7
1 changed files with 6 additions and 8 deletions
|
|
@ -8814,20 +8814,18 @@ void GameHandler::checkAreaTriggers() {
|
|||
|
||||
bool inside = false;
|
||||
if (at.radius > 0.0f) {
|
||||
// Sphere trigger — use generous minimum radius since WMO collision
|
||||
// may block the player from reaching triggers inside doorways/hallways
|
||||
float effectiveRadius = std::max(at.radius, 45.0f);
|
||||
// Sphere trigger — small minimum so player must be near the portal
|
||||
float effectiveRadius = std::max(at.radius, 12.0f);
|
||||
float dx = px - at.x;
|
||||
float dy = py - at.y;
|
||||
float dz = pz - at.z;
|
||||
float distSq = dx * dx + dy * dy + dz * dz;
|
||||
inside = (distSq <= effectiveRadius * effectiveRadius);
|
||||
} else if (at.boxLength > 0.0f || at.boxWidth > 0.0f || at.boxHeight > 0.0f) {
|
||||
// Box trigger — use generous minimum dimensions since WMO collision
|
||||
// may block the player from reaching small triggers inside doorways
|
||||
float effLength = std::max(at.boxLength, 90.0f);
|
||||
float effWidth = std::max(at.boxWidth, 90.0f);
|
||||
float effHeight = std::max(at.boxHeight, 90.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 dx = px - at.x;
|
||||
float dy = py - at.y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue