diff options
-rw-r--r-- | api.lua | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -181,14 +181,12 @@ 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 + 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 - receiverref:get_inventory():add_item("main", itemstack) end end |