From: paramat Date: Tue, 31 Jan 2017 11:41:50 +0000 (+0000) Subject: Creative: Cache creative mode setting X-Git-Tag: 0.4.16~95 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e86955afae515fcb150f98ad4bc86d0aea91d6c7;p=oweals%2Fminetest_game.git Creative: Cache creative mode setting --- diff --git a/mods/creative/init.lua b/mods/creative/init.lua index cd9e2b49..7471e603 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,7 +1,9 @@ creative = {} +local creative_mode_cache = minetest.setting_getbool("creative_mode") + function creative.is_enabled_for(name) - return minetest.setting_getbool("creative_mode") + return creative_mode_cache end dofile(minetest.get_modpath("creative") .. "/inventory.lua")