Skip to content

Instantly share code, notes, and snippets.

@celeron55
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celeron55/8d222e3cb0c1fd7c58e6 to your computer and use it in GitHub Desktop.
Save celeron55/8d222e3cb0c1fd7c58e6 to your computer and use it in GitHub Desktop.
diff --git a/minetest.conf.example b/minetest.conf.example
index 7b8ab36..3efccc1 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -98,8 +98,6 @@
#show_debug = false
# Enable a bit lower water surface; disable for speed (not quite optimized)
#new_style_water = false
-# Max liquids processed per step
-#liquid_loop_max = 10000
# Update liquids every .. recommend for finite: 0.2
#liquid_update = 1.0
# Enable nice leaves; disable for speed
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 1ebf5dc..67ebc27 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -276,7 +276,6 @@ void set_default_settings(Settings *settings)
settings->setDefault("movement_gravity", "9.81");
//liquid stuff
- settings->setDefault("liquid_loop_max", "10000");
settings->setDefault("liquid_update", "1.0");
//mapgen stuff
diff --git a/src/map.cpp b/src/map.cpp
index 009bc3d..7c94348 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1628,12 +1628,14 @@ 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");
+ // TODO: Dynamic limiting of the loop count for smoothing bursts
+ // TODO: DoS prevention by dropping the queue if processing it takes too
+ // long (maybe 30 seconds or so)
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 >= loop_max)
+ if(loopcount >= initial_size)
break;
loopcount++;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment