1
0
Fork 0

Fix shift-clicking and a few luacheck warnings

This commit is contained in:
Mikita Wiśniewski 2024-06-26 11:52:26 +07:00 committed by the-real-herowl
parent c5bc6ff189
commit f1fa6240bb
5 changed files with 18 additions and 15 deletions

View File

@ -6,7 +6,6 @@ local get_double_container_neighbor_pos = mcl_util.get_double_container_neighbor
local string = string local string = string
local table = table local table = table
local math = math
local sf = string.format local sf = string.format
@ -381,7 +380,7 @@ local function limit_put_list(stack, list)
end end
local function limit_put(stack, top_inv, bottom_inv) local function limit_put(stack, top_inv, bottom_inv)
local leftover = ItemStack(staick) local leftover = ItemStack(stack)
leftover = limit_put_list(leftover, top_inv:get_list("main")) leftover = limit_put_list(leftover, top_inv:get_list("main"))
leftover = limit_put_list(leftover, bottom_inv:get_list("main")) leftover = limit_put_list(leftover, bottom_inv:get_list("main"))
return stack:get_count() - leftover:get_count() return stack:get_count() - leftover:get_count()
@ -496,9 +495,17 @@ local function log_inventory_put_double(side) return function(pos, listname, ind
" moves stuff to chest at " .. minetest.pos_to_string(pos)) " moves stuff to chest at " .. minetest.pos_to_string(pos))
-- BEGIN OF LISTRING WORKAROUND -- BEGIN OF LISTRING WORKAROUND
if listname == "input" then if listname == "input" then
local top_inv, bottom_inv = get_chest_inventories(pos, side) local inv = minetest.get_inventory({ type = "node", pos = pos })
top_inv:set_stack("input", 1, nil) local other_pos = get_double_container_neighbor_pos(pos, minetest.get_node(pos).param2, side)
double_chest_add_item(top_inv, bottom_inv, "main", stack) local other_inv = minetest.get_inventory({ type = "node", pos = other_pos })
inv:set_stack("input", 1, nil)
if side == "left" then
double_chest_add_item(inv, other_inv, "main", stack)
else
double_chest_add_item(other_inv, inv, "main", stack)
end
end end
-- END OF LISTRING WORKAROUND -- END OF LISTRING WORKAROUND
end end end end

View File

@ -1,6 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
local C = minetest.colorize
local get_double_container_neighbor_pos = mcl_util.get_double_container_neighbor_pos local get_double_container_neighbor_pos = mcl_util.get_double_container_neighbor_pos
local chestusage = S("To access its inventory, rightclick it. When broken, the items will drop out.") local chestusage = S("To access its inventory, rightclick it. When broken, the items will drop out.")

View File

@ -1,6 +1,4 @@
local string = string local string = string
local table = table
local math = math
local sm = string.match local sm = string.match