forked from mtcontrib/3d_armor
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)
|
armor:set_player_armor(player)
|
||||||
end,
|
end,
|
||||||
allow_put = function(inv, listname, index, put_stack, player)
|
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())
|
local element = armor:get_element(put_stack:get_name())
|
||||||
if not element then
|
if not element then
|
||||||
return 0
|
return 0
|
||||||
@ -208,9 +211,15 @@ local function init_player_armor(initplayer)
|
|||||||
return 1
|
return 1
|
||||||
end,
|
end,
|
||||||
allow_take = function(inv, listname, index, stack, player)
|
allow_take = function(inv, listname, index, stack, player)
|
||||||
|
if player:get_player_name() ~= name then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
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
|
return count
|
||||||
end,
|
end,
|
||||||
}, name)
|
}, name)
|
||||||
|
Loading…
Reference in New Issue
Block a user