Ship Routes: no edge marker on top of a dock near the map edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-11-12 15:08:33 +00:00
parent 0a810dc451
commit e070e5dfa5
2 changed files with 14 additions and 3 deletions

View file

@ -24,6 +24,7 @@ local HOME_MAP = { [0] = 1415, [1] = 1414, [2991] = 2521 }
local NEARBY = 800 -- yards: other departures this close show in a dock's tooltip
local EXIT_INSET = 0.025 -- share of the map an edge marker sits inside the border
local EXIT_MERGE = 0.06 -- edge markers closer than this share of the map width merge
local EXIT_NEAR = 0.08 -- no edge marker this close to its own dock: the dock already says where it goes
local db
@ -439,7 +440,12 @@ function provider:RefreshAllData()
end
local x, y, angle, edge = ExitPoint(walk, W, H)
if x then
exits[#exits + 1] = { route = route, leg = leg, far = far, x = x, y = y, angle = angle, edge = edge }
local mx = math.max(EXIT_INSET, math.min(1 - EXIT_INSET, x / W)) * W
local my = math.max(EXIT_INSET, math.min(1 - EXIT_INSET, y / H)) * H
local dx, dy = mx - walk[1], my - walk[2]
if dx * dx + dy * dy > (EXIT_NEAR * W) ^ 2 then
exits[#exits + 1] = { route = route, leg = leg, far = far, x = x, y = y, angle = angle, edge = edge }
end
end
end
end