From 822baae79da42fd863899bcb031cdaf510d2978a Mon Sep 17 00:00:00 2001 From: Austin Hicks Date: Wed, 2 Oct 2024 19:37:43 -0700 Subject: [PATCH] Trees fixes --- scripts/scanner/backends/simple.lua | 2 +- scripts/scanner/backends/trees.lua | 2 +- scripts/scanner/backends/water.lua | 2 +- scripts/scanner/entrypoint.lua | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/scanner/backends/simple.lua b/scripts/scanner/backends/simple.lua index f8624c2e..920faa4f 100644 --- a/scripts/scanner/backends/simple.lua +++ b/scripts/scanner/backends/simple.lua @@ -70,7 +70,7 @@ function SimpleBackend:fillout_entry(entity, entry) entry.subcategory = self.subcategory_callback(entity) end -function SimpleBackend:update_entry(e) +function SimpleBackend:update_entry(_player, e) self:fillout_entry(e.backend_data, e) end diff --git a/scripts/scanner/backends/trees.lua b/scripts/scanner/backends/trees.lua index d714bc14..1563ac75 100644 --- a/scripts/scanner/backends/trees.lua +++ b/scripts/scanner/backends/trees.lua @@ -83,7 +83,7 @@ function TreeBackend:update_entry(player, e) local trees = self.surface.find_entities_filtered({ area = aabb, tpe = "tree" }) local closest = self.surface.get_closest(player.position, trees) -- It's still in the AABB, just a different point. - e.position = closest + e.position = closest.position end function TreeBackend:validate_entry(e) diff --git a/scripts/scanner/backends/water.lua b/scripts/scanner/backends/water.lua index 2c808660..f13fbf6b 100644 --- a/scripts/scanner/backends/water.lua +++ b/scripts/scanner/backends/water.lua @@ -41,7 +41,7 @@ function WaterBackend:validate_entry(player, e) }) > 0 end -function WaterBackend:update_entry(e) end +function WaterBackend:update_entry(player, e) end function WaterBackend:readout_entry(player, e) local bb = e.bounding_box diff --git a/scripts/scanner/entrypoint.lua b/scripts/scanner/entrypoint.lua index c95653ec..100a03d4 100644 --- a/scripts/scanner/entrypoint.lua +++ b/scripts/scanner/entrypoint.lua @@ -406,13 +406,12 @@ local function announce_cursor_pos(pindex, ps) ::do_announce:: if announcing then - print(serpent.line(announcing.position, { nocode = true })) -- fa-info has dependencies on having the cursor in the right place that -- we can't remove, so just set it first. global.players[pindex].cursor_pos = announcing.position -- And for the same reason--we shouldn't be caching tile contents, but we do. refresh_player_tile(pindex) - announcing.backend:update_entry(announcing) + announcing.backend:update_entry(pobj, announcing) printout({ "fa.scanner-full-presentation", announcing.backend:readout_entry(pobj, announcing),