diff options
author | rubenwardy <rubenwardy@gmail.com> | 2015-07-30 09:29:04 +0100 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2015-07-30 09:29:04 +0100 |
commit | 7c0a7b5a330b867e486081cc6be642f9b4fe7c31 (patch) | |
tree | c9b752221199495dcbe3575640c9b4c4ff7f3426 | |
parent | 22be456ab79ce5a5e9a04c7fdaee7d6c2774b294 (diff) |
Cache disable_fallbacks etc settings
-rw-r--r-- | food/init.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/food/init.lua b/food/init.lua index e1323c6..60a52a6 100644 --- a/food/init.lua +++ b/food/init.lua @@ -10,7 +10,11 @@ food = { modules = {}, disabled_modules = {}, debug = false, - version = 2.3 + version = 2.3, + disable_fallbacks = + minetest.setting_getbool("food.disable_fallbacks"), + suppress_no_fallback_error = + minetest.setting_getbool("food.suppress_no_fallback_error") } -- Checks for external content, and adds support @@ -90,8 +94,8 @@ function food.module(name, func, ingred) end end - if minetest.setting_getbool("food.disable_fallbacks") then - if minetest.setting_getbool("food.suppress_no_fallback_error") then + if food.disable_fallbacks then + if food.suppress_no_fallback_error then print("Warning: Fallbacks are disabled, and no item for " .. name .. " registered!") else error("Food: Fallbacks are disabled, and no item for " .. name .. " registered!") |