summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autodetect-finite-water.lua9
-rw-r--r--init.lua5
2 files changed, 14 insertions, 0 deletions
diff --git a/autodetect-finite-water.lua b/autodetect-finite-water.lua
new file mode 100644
index 0000000..d218e80
--- /dev/null
+++ b/autodetect-finite-water.lua
@@ -0,0 +1,9 @@
+-- enable finite liquid in the presence of dynamic liquid to preserve water volume.
+local enable = false
+
+if minetest.get_modpath("dynamic_liquid") then
+ pipeworks.logger("detected mod dynamic_liquid, enabling finite liquid flag")
+ enable = true
+end
+
+pipeworks.toggles.finite_water = enable
diff --git a/init.lua b/init.lua
index 8bae8e8..8974005 100644
--- a/init.lua
+++ b/init.lua
@@ -103,6 +103,11 @@ end
-------------------------------------------
-- Load the various other parts of the mod
+-- early auto-detection for finite water mode if not explicitly disabled
+if pipeworks.toggles.finite_water == nil then
+ dofile(pipeworks.modpath.."/autodetect-finite-water.lua")
+end
+
dofile(pipeworks.modpath.."/common.lua")
dofile(pipeworks.modpath.."/models.lua")
dofile(pipeworks.modpath.."/autoplace_pipes.lua")