Skip to content

Commit

Permalink
Fire: Use 'enable fire' setting instead of 'disable fire'
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Aug 20, 2016
1 parent 0883854 commit cabf80b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions minetest.conf.example
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions mods/fire/init.lua
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit cabf80b

Please sign in to comment.