mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-26 21:13:51 +00:00
fix(areatrigger): use actual DBC dimensions instead of inflated minimums
The minimum floor (3.0 for sphere radius, 4.0 for box dimensions) was inflating narrow triggers like AT 5711 (boxWidth 1.06 → 4.0), causing false area trigger fires near the Stormwind AH and unexpected teleports.
This commit is contained in:
parent
e0ef682b1e
commit
0d188edd75
1 changed files with 6 additions and 8 deletions
|
|
@ -2547,19 +2547,17 @@ void MovementHandler::checkAreaTriggers() {
|
|||
|
||||
bool inside = false;
|
||||
if (at.radius > 0.0f) {
|
||||
// Sphere trigger — use actual radius, with small floor for very tiny triggers
|
||||
float effectiveRadius = std::max(at.radius, 3.0f);
|
||||
// Sphere trigger — use actual DBC radius
|
||||
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);
|
||||
inside = (distSq <= at.radius * at.radius);
|
||||
} else if (at.boxLength > 0.0f || at.boxWidth > 0.0f || at.boxHeight > 0.0f) {
|
||||
// Box trigger — use actual size, with small floor for tiny triggers
|
||||
float boxMin = 4.0f;
|
||||
float effLength = std::max(at.boxLength, boxMin);
|
||||
float effWidth = std::max(at.boxWidth, boxMin);
|
||||
float effHeight = std::max(at.boxHeight, boxMin);
|
||||
// Box trigger — use actual DBC dimensions
|
||||
float effLength = at.boxLength;
|
||||
float effWidth = at.boxWidth;
|
||||
float effHeight = at.boxHeight;
|
||||
|
||||
float dx = px - at.x;
|
||||
float dy = py - at.y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue