summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2016-07-29 17:30:59 +0100
committerrubenwardy <rubenwardy@gmail.com>2016-07-29 17:31:13 +0100
commit1fe166e2c5e2abe6830f3b5d7957a0388f0c0458 (patch)
treed31c94b775c8a2b7edee7a8c29e4ee0245eff9f6
parent96746aaf1e2c2c07dccafd9a6cebdbb15914ee98 (diff)
Fix prize giving bug
-rw-r--r--api.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/api.lua b/api.lua
index 212e294..c851694 100644
--- a/api.lua
+++ b/api.lua
@@ -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