aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/map.cpp8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 71c283241..ffaa7a3c7 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -209,6 +209,7 @@ void set_default_settings(Settings *settings)
//liquid stuff
settings->setDefault("liquid_finite", "false");
+ settings->setDefault("liquid_loop_max", "1000");
settings->setDefault("liquid_update", "1.0");
settings->setDefault("liquid_relax", "2");
settings->setDefault("liquid_fast_flood", "1");
diff --git a/src/map.cpp b/src/map.cpp
index 7439076d3..001ae1609 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1651,10 +1651,12 @@ void Map::transformLiquidsFinite(std::map<v3s16, MapBlock*> & modified_blocks)
// List of MapBlocks that will require a lighting update (due to lava)
std::map<v3s16, MapBlock*> lighting_modified_blocks;
+ u16 loop_max = g_settings->getU16("liquid_loop_max");
+
while (m_transforming_liquid.size() > 0)
{
// This should be done here so that it is done when continue is used
- if (loopcount >= initial_size || loopcount >= 1000)
+ if (loopcount >= initial_size || loopcount >= loop_max)
break;
loopcount++;
/*
@@ -1993,10 +1995,12 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
// List of MapBlocks that will require a lighting update (due to lava)
std::map<v3s16, MapBlock*> lighting_modified_blocks;
+ u16 loop_max = g_settings->getU16("liquid_loop_max");
+
while(m_transforming_liquid.size() != 0)
{
// This should be done here so that it is done when continue is used
- if(loopcount >= initial_size || loopcount >= 10000)
+ if(loopcount >= initial_size || loopcount >= loop_max)
break;
loopcount++;