Skip to content

Commit

Permalink
fix injectors taking items from chests randomly
Browse files Browse the repository at this point in the history
  • Loading branch information
OgelGames committed Dec 8, 2020
1 parent f85663f commit 87ff1b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions technic_chests/register.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ function technic.chests.register_chest(name, data)
end
return can_insert
end,
remove_items = function(pos, node, stack, dir, count)
remove_items = function(pos, node, stack, dir, count, list, index)
local meta = minetest.get_meta(pos)
local item = stack:take_item(count) -- pipeworks doesn't set the stack count the same as count :/
local removed = meta:get_inventory():remove_item("main", item)
local item = stack:take_item(count)
meta:get_inventory():set_stack(list, index, stack)
if data.digilines and meta:get_int("send_pull") == 1 then
technic.chests.send_digiline_message(pos, "pull", nil, {removed:to_table()})
technic.chests.send_digiline_message(pos, "pull", nil, {item:to_table()})
end
technic.chests.log_inv_change(pos, "pipeworks tube", "take", stack:get_name())
return removed
technic.chests.log_inv_change(pos, "pipeworks tube", "take", item:get_name())
return item
end,
input_inventory = "main",
connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
Expand Down

0 comments on commit 87ff1b4

Please sign in to comment.