Skip to content

Commit

Permalink
Trees fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahicks92 committed Oct 3, 2024
1 parent cc033c7 commit 822baae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/scanner/backends/simple.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/scanner/backends/trees.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/scanner/backends/water.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scripts/scanner/entrypoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 822baae

Please sign in to comment.