From 6f99803d2d762b810e105360b055178b64088b9b Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sat, 2 Jun 2018 20:46:44 +0100 Subject: [PATCH] Return invalid items in singleplayer mode --- 3d_armor/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/3d_armor/init.lua b/3d_armor/init.lua index 1c498ae..a9b7d11 100644 --- a/3d_armor/init.lua +++ b/3d_armor/init.lua @@ -143,13 +143,13 @@ local function validate_armor_inventory(player) else inv:remove_item("armor", stack) -- The following code returns invalid items to the player's main - -- inventory but could open up the possibity for hacked client + -- inventory but could open up the possibity for a hacked client -- to receive items back they never really had. I am not certain - -- so un-comment this section at your own risk :) - - --if player_inv and player_inv:room_for_item("main", stack) then - -- player_inv:add_item("main", stack) - --end + -- so remove the is_singleplayer check at your own risk :] + if minetest.is_singleplayer() and player_inv and + player_inv:room_for_item("main", stack) then + player_inv:add_item("main", stack) + end end end end