fix: resolve 7 code quality issues across PRs #59-63

- Remove stale kVOffset (-0.15) from zone_highlight_layer hover detection;
  the offset was removed from rendering but left in the hit-test path,
  shifting hover ~15% vertically
- Add null guard for cachedGameHandler_ in ChatPanel::inputTextCallback
  to prevent dereference before first render frame
- Zero WindowBorderSize in world map ImGui window to eliminate gap
  between window edge and map content
- Replace hardcoded cosmic highlight multipliers with displayH×displayH
  square rendering, preserving 1:1 aspect ratio at any resolution
- Skip transport waypoints where serverToCanonical zeroes nonzero input
  instead of silently building paths with broken (0,0,0) coordinates
- Use length-squared check (posLenSq > 1.0) for spline endpoint
  validation instead of per-component != 0 comparison, so entities
  near the world origin are no longer skipped
- Fix off-by-one in ChatPanel::insertChatLink buffer capacity check
This commit is contained in:
Kelsi 2026-04-14 02:41:55 -07:00
parent 9547feabf9
commit 3be40c3b69
5 changed files with 20 additions and 22 deletions

View file

@ -299,9 +299,10 @@ bool parseWotlkMoveUpdateSpline(
packet.setReadPos(prePointCount);
return false;
}
// Proximity check: if entity position is known, reject endpoints that
// are implausibly far from it (catches misinterpreted compressed data).
if (entityPos.x != 0.0f || entityPos.y != 0.0f || entityPos.z != 0.0f) {
// Proximity check: if entity position is known (not the default 0,0,0
// sentinel), reject endpoints that are implausibly far from it.
float posLenSq = entityPos.x * entityPos.x + entityPos.y * entityPos.y + entityPos.z * entityPos.z;
if (posLenSq > 1.0f) {
float dx = epX - entityPos.x;
float dy = epY - entityPos.y;
float dz = epZ - entityPos.z;

View file

@ -315,12 +315,13 @@ bool TransportPathRepository::loadTransportAnimationDBC(pipeline::AssetManager*
// Negate X and Y before converting to canonical (Z=height stays the same).
glm::vec3 canonical = core::coords::serverToCanonical(glm::vec3(-pos.x, -pos.y, pos.z));
// CRITICAL: Detect if serverToCanonical is zeroing nonzero inputs
// Skip waypoints where serverToCanonical zeroes nonzero inputs
if ((pos.x != 0.0f || pos.y != 0.0f || pos.z != 0.0f) &&
(canonical.x == 0.0f && canonical.y == 0.0f && canonical.z == 0.0f)) {
LOG_ERROR("serverToCanonical ZEROED! entry=", transportEntry,
LOG_ERROR("serverToCanonical ZEROED — skipping waypoint! entry=", transportEntry,
" server=(", pos.x, ",", pos.y, ",", pos.z, ")",
" → canon=(", canonical.x, ",", canonical.y, ",", canonical.z, ")");
continue;
}
// Debug waypoint conversion for first transport (entry 2074)