give achievement function

This commit is contained in:
Rubenwardy
2013-02-22 19:35:43 +00:00
parent 3b845c0d81
commit 6a982c03be
2 changed files with 35 additions and 7 deletions

View File

@ -49,14 +49,9 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
for i=1,# awards.onDig do
local res=awards.onDig[i](player,data)
if not data['unlocked'] then
data['unlocked']={}
end
if res~=nil and (not data['unlocked'][res] or data['unlocked'][res]~=res) then
data['unlocked'][res]=res
minetest.chat_send_player(playern, "Achievement Unlocked: "..res)
if res~=nil then
awards.give_achievement(playern,res)
end
end
end