diff options
author | Rubenwardy <anjayward@gmail.com> | 2013-11-12 19:50:25 +0000 |
---|---|---|
committer | Rubenwardy <anjayward@gmail.com> | 2013-11-12 19:50:25 +0000 |
commit | 4fe55f3a1490fa90b329af66942712a5ff9f829d (patch) | |
tree | 554916f159ca57a68680b2dd769c5e1e5b59e1da /api.lua | |
parent | 6387bd1d9e128c23bd47b1bbf0544362f8fdbfba (diff) |
Update
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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") |