Skip to content

Commit

Permalink
Creative: Cache creative mode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Feb 1, 2017
1 parent d560f59 commit e86955a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mods/creative/init.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit e86955a

Please sign in to comment.