mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 06:13:45 +01:00
Fix detached inventory vulnerability (#23)
This commit is contained in:
parent
7436fcdffe
commit
5958b312ac
@ -193,6 +193,9 @@ local function init_player_armor(initplayer)
|
||||
armor:set_player_armor(player)
|
||||
end,
|
||||
allow_put = function(inv, listname, index, put_stack, player)
|
||||
if player:get_player_name() ~= name then
|
||||
return 0
|
||||
end
|
||||
local element = armor:get_element(put_stack:get_name())
|
||||
if not element then
|
||||
return 0
|
||||
@ -208,9 +211,15 @@ local function init_player_armor(initplayer)
|
||||
return 1
|
||||
end,
|
||||
allow_take = function(inv, listname, index, stack, player)
|
||||
if player:get_player_name() ~= name then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
if player:get_player_name() ~= name then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
}, name)
|
||||
|
Loading…
Reference in New Issue
Block a user