Fire: Disable fire by default in multiplayer
authorezhh <owlecho@live.com>
Mon, 10 Apr 2017 01:23:00 +0000 (02:23 +0100)
committerparamat <mat.gregory@virginmedia.com>
Mon, 15 May 2017 16:39:59 +0000 (17:39 +0100)
mods/fire/init.lua

index a9ceb9ea7dd8bf2f11d5a8e363020dbc1a7f0729..2dbf5dfd3febe7ce4804c15281644a431e84145a 100644 (file)
@@ -292,9 +292,14 @@ minetest.register_abm({
 
 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")
+       -- enable_fire setting not specified, check for disable_fire
+       local fire_disabled = minetest.setting_getbool("disable_fire")
+       if fire_disabled == nil then
+               -- Neither setting specified, check whether singleplayer
+               fire_enabled = minetest.is_singleplayer()
+       else
+               fire_enabled = not fire_disabled
+       end
 end
 
 if not fire_enabled then