From b1ebd9f79c63cf78b0e0fb2ea6f52d82cdfb95b6 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 8 Jun 2013 23:42:46 +0000 Subject: Add a setting for max loop count per step in liquid update --- src/map.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/map.cpp') 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 & modified_blocks) // List of MapBlocks that will require a lighting update (due to lava) std::map 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 & modified_blocks) // List of MapBlocks that will require a lighting update (due to lava) std::map 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++; -- cgit v1.2.3