This commit is contained in:
Rubenwardy
2013-11-12 19:50:25 +00:00
parent 6387bd1d9e
commit 4fe55f3a14
2 changed files with 26 additions and 36 deletions

18
api.lua
View File

@ -35,11 +35,10 @@ end
-- A table of award definitions
awards.def = {}
function awards.tbv(tb,value)
awards.tbv_default(tb,value,{})
end
function awards.tbv_default(tb,value,default)
function awards.tbv(tb,value,default)
if not default then
default = {}
end
if not tb or type(tb) ~= "table" then
if not value then
value = "[NULL]"
@ -58,6 +57,15 @@ function awards.tbv_default(tb,value,default)
end
end
function awards.assertPlayer(playern)
awards.tbv(awards.players, playern)
awards.tbv(awards.players[playern], "name", playern)
awards.tbv(awards.players[playern], "unlocked")
awards.tbv(awards.players[playern], "place")
awards.tbv(awards.players[playern], "count")
awards.tbv(awards.players[playern], "deaths", 0)
end
-- Load files
dofile(minetest.get_modpath("awards").."/triggers.lua")
dofile(minetest.get_modpath("awards").."/config.txt")