mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Protect on_pick_up against unsafe usage
This commit is contained in:
parent
d00f5a695f
commit
34dcba0b70
@ -3134,9 +3134,9 @@ local function check_item_pickup(self)
|
|||||||
for k,v in pairs(self.pick_up) do
|
for k,v in pairs(self.pick_up) do
|
||||||
if not player_near(p) and self.on_pick_up and l.itemstring:find(v) then
|
if not player_near(p) and self.on_pick_up and l.itemstring:find(v) then
|
||||||
local r = self.on_pick_up(self,l)
|
local r = self.on_pick_up(self,l)
|
||||||
if r and r:get_count() > 0 then
|
if r and r.is_empty and not r:is_empty() then
|
||||||
l.itemstring = r:to_string()
|
l.itemstring = r:to_string()
|
||||||
else
|
elseif r and r.is_empty and r:is_empty() then
|
||||||
o:remove()
|
o:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user