Skip to content

Commit

Permalink
Work around buggy logic in control.lua that breaks water when the sca…
Browse files Browse the repository at this point in the history
…n wants to land the cursor on a corner of it by offsetting to the middle of the tile
  • Loading branch information
ahicks92 committed Oct 6, 2024
1 parent f6865ad commit f0b51ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/scanner/backends/water.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ function WaterBackend:dump_entries_to_callback(player, callback)
bry = bry + 1

callback({
position = { x = e_x, y = e_y },
-- This is fun. If we use the corner of the tile, confused geometry in
-- the cursor handling code will currently corrupt the cursor to
-- temporarily be off by one tile to the northwest in some and only
-- some contexts. Since this won't break in future, we offset to the
-- center of the tile to fix that.
position = { x = e_x + 0.5, y = e_y + 0.5 },
backend_data = {
aabb = {
left_top = { x = tlx, y = tly },
Expand Down

0 comments on commit f0b51ab

Please sign in to comment.