1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00

new module inserter_drops_pickup

Small QoL addition to pick up an item an inserter put down on the ground. If the inventory is full after mining the item, the inserter is left behind as an item-on-ground (versus not mined at all when the inventory is full)
This commit is contained in:
Jacob
2021-11-08 21:58:32 -05:00
parent 34c630da7b
commit a2bac17e91
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@ require 'antigrief'
require 'modules.corpse_markers'
require 'modules.floaty_chat'
require 'modules.show_inventory'
require 'modules.inserter_drops_pickup'
require 'utils.debug.command'
require 'comfy_panel.main'
+11
View File
@@ -0,0 +1,11 @@
local Event = require 'utils.event'
Event.add(defines.events.on_player_mined_entity, function(event)
local inserter = event.entity
if (not inserter.valid) or (inserter.type ~= "inserter") or inserter.drop_target then return end
local item_entity = inserter.surface.find_entity("item-on-ground", inserter.drop_position)
if item_entity then
game.get_player(event.player_index).mine_entity(item_entity)
end
end)