mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 14:23:45 +01:00
drop invalid item instead of erase it
This commit is contained in:
parent
47ecef46f7
commit
2ac90f8d19
@ -110,6 +110,7 @@ end)
|
|||||||
local function validate_armor_inventory(player)
|
local function validate_armor_inventory(player)
|
||||||
-- Workaround for detached inventory swap exploit
|
-- Workaround for detached inventory swap exploit
|
||||||
local _, inv = armor:get_valid_player(player, "[validate_armor_inventory]")
|
local _, inv = armor:get_valid_player(player, "[validate_armor_inventory]")
|
||||||
|
local pos = player:get_pos()
|
||||||
if not inv then
|
if not inv then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -140,6 +141,7 @@ local function validate_armor_inventory(player)
|
|||||||
elements[element] = true;
|
elements[element] = true;
|
||||||
else
|
else
|
||||||
inv:remove_item("armor", stack)
|
inv:remove_item("armor", stack)
|
||||||
|
minetest.item_drop(stack, player, pos)
|
||||||
-- The following code returns invalid items to the player's main
|
-- The following code returns invalid items to the player's main
|
||||||
-- inventory but could open up the possibity for a 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
|
-- to receive items back they never really had. I am not certain
|
||||||
|
Loading…
Reference in New Issue
Block a user