aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2014-12-26 15:33:18 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2014-12-26 15:33:18 -0500
commit47bc762955aec6ae772bc2f8936d774a1d6be86b (patch)
treed3e7ad30ba649f96e90c4ee988188c25bc9860a3
parent8056fa6c182ea091c28ee5ad80f8c45e7af269f3 (diff)
downloadcurrency-47bc762955aec6ae772bc2f8936d774a1d6be86b.tar.gz
currency-47bc762955aec6ae772bc2f8936d774a1d6be86b.tar.bz2
currency-47bc762955aec6ae772bc2f8936d774a1d6be86b.zip
make basic income only happen in Survival mode
also cache the output of minetest.get_modpath()
-rw-r--r--init.lua21
1 files changed, 14 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index c7caffe..0c94994 100644
--- a/init.lua
+++ b/init.lua
@@ -1,13 +1,20 @@
print(" Currency mod loading... ")
-dofile(minetest.get_modpath("currency").."/craftitems.lua")
+local modpath = minetest.get_modpath("currency")
+
+dofile(modpath.."/craftitems.lua")
print("[Currency] Craft_items Loaded!")
-dofile(minetest.get_modpath("currency").."/shop.lua")
+dofile(modpath.."/shop.lua")
print("[Currency] Shop Loaded!")
-dofile(minetest.get_modpath("currency").."/barter.lua")
+dofile(modpath.."/barter.lua")
print("[Currency] Barter Loaded!")
-dofile(minetest.get_modpath("currency").."/safe.lua")
+dofile(modpath.."/safe.lua")
print("[Currency] Safe Loaded!")
-dofile(minetest.get_modpath("currency").."/crafting.lua")
+dofile(modpath.."/crafting.lua")
print("[Currency] Crafting Loaded!")
-dofile(minetest.get_modpath("currency").."/income.lua")
-print("[Currency] Income Loaded!")
+
+if minetest.setting_getbool("creative_mode") then
+ print("[Currency] Creative mode in use, skipping basic income.")
+else
+ dofile(modpath.."/income.lua")
+ print("[Currency] Income Loaded!")
+end