summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2015-06-10 19:18:56 +0100
committerrubenwardy <rubenwardy@gmail.com>2016-07-29 16:02:14 +0100
commit0e2ed176fad83d03375f7176b9093c3274b6e868 (patch)
treed772712d7c028d24d8c8c93dc5327e1521858041
parent30aee5090f65b58c70f888ea203ef2e73fbd4744 (diff)
Separate triggers from API
-rw-r--r--api.lua12
-rw-r--r--init.lua1
2 files changed, 4 insertions, 9 deletions
diff --git a/api.lua b/api.lua
index a7c9506..6ffef7d 100644
--- a/api.lua
+++ b/api.lua
@@ -18,6 +18,7 @@
awards = {
show_mode = "hud"
}
+dofile(minetest.get_modpath("awards").."/helpers.lua")
-- Table Save Load Functions
function awards.save()
@@ -47,8 +48,6 @@ function awards.load()
return {}
end
-awards.init()
-
function awards.register_trigger(name, func)
awards.trigger_types[name] = func
awards.on[name] = {}
@@ -104,7 +103,7 @@ end
-- It checks if a player already has that achievement, and if they do not,
-- it gives it to them
----------------------------------------------
---awards.give_achievement(name,award)
+--awards.give_achievement(name, award)
-- name - the name of the player
-- award - the name of the award to give
function awards.give_achievement(name, award)
@@ -367,9 +366,4 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return true
end)
-
-
-
--- Load files
-dofile(minetest.get_modpath("awards").."/helpers.lua")
-dofile(minetest.get_modpath("awards").."/triggers.lua")
+awards.init()
diff --git a/init.lua b/init.lua
index a3e9082..7278fd6 100644
--- a/init.lua
+++ b/init.lua
@@ -25,6 +25,7 @@ end
dofile(minetest.get_modpath("awards").."/api.lua")
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
+dofile(minetest.get_modpath("awards").."/triggers.lua")
-- Light it up
awards.register_achievement("award_lightitup",{