1
0
réplica de https://gitlab.com/rubenwardy/awards.git sincronizado 2025-10-21 09:45:45 +02:00

Fix prize giving bug

Este cometimento está contido em:
rubenwardy
2016-07-29 17:30:59 +01:00
ascendente 96746aaf1e
cometimento 1fe166e2c5

12
api.lua
Ver ficheiro

@@ -181,16 +181,14 @@ function awards.unlock(name, award)
if awdef and awdef.prizes then
for i = 1, #awdef.prizes do
local itemstack = ItemStack(awdef.prizes[i])
if itemstack:is_empty() or not itemstack:is_known() then
return
end
local receiverref = core.get_player_by_name(name)
if not receiverref then
return
end
if not itemstack:is_empty() then
local receiverref = minetest.get_player_by_name(name)
if receiverref then
receiverref:get_inventory():add_item("main", itemstack)
end
end
end
end
-- Run callbacks
if awdef.on_unlock and awdef.on_unlock(name, awdef) then