From 4fe55f3a1490fa90b329af66942712a5ff9f829d Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Tue, 12 Nov 2013 19:50:25 +0000 Subject: Update --- api.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'api.lua') diff --git a/api.lua b/api.lua index c399770..444b4ba 100644 --- a/api.lua +++ b/api.lua @@ -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") -- cgit v1.2.3