mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 16:39:33 +01:00
Fix on_pick_up api
accepts a returned itemstring from the callback now
This commit is contained in:
parent
79265a596b
commit
8cb73ee509
1 changed files with 6 additions and 1 deletions
|
@ -3133,7 +3133,12 @@ local function check_item_pickup(self)
|
|||
if l and l.name == "__builtin:item" then
|
||||
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 self.on_pick_up(self,l) == nil then o:remove() end
|
||||
local r = self.on_pick_up(self,l)
|
||||
if r then
|
||||
l.itemstring = r:to_string()
|
||||
else
|
||||
o:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue