Skip to content

Commit cabf80b

Browse files
committedAug 20, 2016
Fire: Use 'enable fire' setting instead of 'disable fire'
1 parent 0883854 commit cabf80b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
 

Diff for: ‎minetest.conf.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
# 0 to disable. By default it is "share_bones_time" divide by four.
2121
#share_bones_time_early = 300
2222

23-
# Whether standard fire should be disabled ('basic flame' nodes will disappear)
24-
# 'permanent flame' nodes will remain with either setting
25-
#disable_fire = false
23+
# Whether fire should be enabled. If disabled, 'basic flame' nodes will disappear.
24+
# 'permanent flame' nodes will remain with either setting.
25+
#enable_fire = true
2626

2727
# Whether the stuff in initial_stuff should be given to new players
2828
#give_initial_stuff = false

Diff for: ‎mods/fire/init.lua

+10-3
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,16 @@ minetest.register_abm({
235235
})
236236

237237

238-
-- Enable the following ABMs according to 'disable fire' setting
238+
-- Enable the following ABMs according to 'enable fire' setting
239239

240-
if minetest.setting_getbool("disable_fire") then
240+
local fire_enabled = minetest.setting_getbool("enable_fire")
241+
if fire_enabled == nil then
242+
-- New setting not specified, check for old setting.
243+
-- If old setting is also not specified, 'not nil' is true.
244+
fire_enabled = not minetest.setting_getbool("disable_fire")
245+
end
246+
247+
if not fire_enabled then
241248

242249
-- Remove basic flames only
243250

@@ -250,7 +257,7 @@ if minetest.setting_getbool("disable_fire") then
250257
action = minetest.remove_node,
251258
})
252259

253-
else
260+
else -- Fire enabled
254261

255262
-- Ignite neighboring nodes, add basic flames
256263

0 commit comments

Comments
 (0)
Please sign in to comment.