From: paramat Date: Mon, 15 Aug 2016 20:29:52 +0000 (+0100) Subject: Fire: Use 'enable fire' setting instead of 'disable fire' X-Git-Tag: 0.4.15~106 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cabf80b743e64869092127608c4d9ef5e09592c0;p=oweals%2Fminetest_game.git Fire: Use 'enable fire' setting instead of 'disable fire' --- diff --git a/minetest.conf.example b/minetest.conf.example index d6e00000..f5e4e85d 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -20,9 +20,9 @@ # 0 to disable. By default it is "share_bones_time" divide by four. #share_bones_time_early = 300 -# Whether standard fire should be disabled ('basic flame' nodes will disappear) -# 'permanent flame' nodes will remain with either setting -#disable_fire = false +# Whether fire should be enabled. If disabled, 'basic flame' nodes will disappear. +# 'permanent flame' nodes will remain with either setting. +#enable_fire = true # Whether the stuff in initial_stuff should be given to new players #give_initial_stuff = false diff --git a/mods/fire/init.lua b/mods/fire/init.lua index 3e04264e..6543ceef 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -235,9 +235,16 @@ minetest.register_abm({ }) --- Enable the following ABMs according to 'disable fire' setting +-- Enable the following ABMs according to 'enable fire' setting -if minetest.setting_getbool("disable_fire") then +local fire_enabled = minetest.setting_getbool("enable_fire") +if fire_enabled == nil then + -- New setting not specified, check for old setting. + -- If old setting is also not specified, 'not nil' is true. + fire_enabled = not minetest.setting_getbool("disable_fire") +end + +if not fire_enabled then -- Remove basic flames only @@ -250,7 +257,7 @@ if minetest.setting_getbool("disable_fire") then action = minetest.remove_node, }) -else +else -- Fire enabled -- Ignite neighboring nodes, add basic flames