Quick fix for player physical position

This commit is contained in:
Cooldude2606
2024-10-19 18:30:58 +01:00
parent 90d0a122cd
commit 34a7879761
31 changed files with 82 additions and 41 deletions

View File

@@ -41,7 +41,7 @@ Selection.on_selection(SelectionConvertArea, function(event)
return
end
local entities = player.surface.find_entities_filtered{ area = area, name = "steel-chest" }
local entities = event.surface.find_entities_filtered{ area = area, name = "steel-chest" }
if #entities == 0 then
player.print("No steel chest found")
@@ -60,6 +60,7 @@ Selection.on_selection(SelectionConvertArea, function(event)
for _, entity in pairs(entities) do
if clf_exp >= 1 then
if entity.get_inventory(defines.inventory.chest).is_empty() then
-- Intentionally left as player.position to allow use in report view
if (math.floor(player.position.x) ~= math.floor(entity.position.x)) or (math.floor(player.position.y) ~= math.floor(entity.position.y)) then
table.insert(tiles_to_make, { name = "water-mud", position = entity.position })
entity.destroy()