diff --git a/static/script.js b/static/script.js index f405585d..85e2909f 100644 --- a/static/script.js +++ b/static/script.js @@ -3969,8 +3969,8 @@ function updateRadarWindow(msg) { ctx.stroke(); // Rotate world by heading so player facing = up on canvas - // In dungeons, add 180° to match UB's (heading - 180) rotation - const rotAngle = isDungeon ? headingRad + Math.PI : headingRad; + // In dungeons, use (PI - heading) to match UB's canvas rotation + const rotAngle = isDungeon ? (Math.PI - headingRad) : headingRad; // Draw objects and cache positions for click hit-testing const cosA = Math.cos(rotAngle); @@ -3987,7 +3987,9 @@ function updateRadarWindow(msg) { } const dx = dX * cosA - dY * sinA; - const dy = -(dX * sinA + dY * cosA); + // In dungeons, don't negate dy (180° heading offset handles N/S) + // In overworld, negate for north-up + const dy = isDungeon ? (dX * sinA + dY * cosA) : -(dX * sinA + dY * cosA); const px = cx + dx * scale; const py = cy + dy * scale;