From f1b5448049bfdaa5a4c8b4e71ed3a2f94336d377 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sat, 9 Jan 2016 09:55:33 +0000 Subject: Tweaked code to work better for violation drops --- doors_chest.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doors_chest.lua') diff --git a/doors_chest.lua b/doors_chest.lua index 6e1ead9..7b8a464 100644 --- a/doors_chest.lua +++ b/doors_chest.lua @@ -290,7 +290,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.toup then -- copy contents of players inventory to chest - for i, v in ipairs (player_inv:get_list("main") or {}) do + for i, v in pairs (player_inv:get_list("main") or {}) do if chest_inv and chest_inv:room_for_item('main', v) then @@ -309,7 +309,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif fields.todn then -- copy contents of chest to players inventory - for i, v in ipairs (chest_inv:get_list('main') or {}) do + for i, v in pairs (chest_inv:get_list('main') or {}) do if player_inv:room_for_item("main", v) then -- cgit v1.2.3