Skip to content

Commit

Permalink
Auto-delete tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
bengardner committed Mar 19, 2024
1 parent 65b4055 commit 3f403bd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/NetworkChest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,21 @@ end

function M.on_marked_for_deconstruction(event)
local ent = event.entity
-- put any fluids or items in the network
GlobalState.put_contents_in_network(ent)
if ent.name == "deconstructible-tile-proxy" then
--print(string.format("destroy: %s @ %s MP=%s", ent.name, serpent.line(ent.position), serpent.line(ent.prototype.mineable_properties)))
GlobalState.mine_queue(ent)
return
end

if ent.unit_number ~= nil then
-- put any fluids or items in the network
GlobalState.put_contents_in_network(ent)
end

--print(string.format("destroy: %s @ %s MP=%s", ent.name, serpent.line(ent.position), serpent.line(ent.prototype.mineable_properties)))
if ent.prototype.mineable_properties ~= nil and ent.prototype.mineable_properties.minable == true then
-- print(string.format("destroy: TODO [%s] %s @ %s", ent.unit_number, ent.name, serpent.line(ent.position)))
--TODO: queue for destruction in 10 seconds
--
GlobalState.mine_queue(ent)
end
end
Expand Down

0 comments on commit 3f403bd

Please sign in to comment.