@@ -1624,8 +1624,6 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
1624
1624
u32 loopcount = 0 ;
1625
1625
u32 initial_size = m_transforming_liquid.size ();
1626
1626
1627
- u32 curr_time = getTime (PRECISION_MILLI);
1628
-
1629
1627
/* if(initial_size != 0)
1630
1628
infostream<<"transformLiquids(): initial_size="<<initial_size<<std::endl;*/
1631
1629
@@ -1638,11 +1636,11 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
1638
1636
u32 liquid_loop_max = g_settings->getS32 (" liquid_loop_max" );
1639
1637
u32 loop_max = liquid_loop_max;
1640
1638
1641
- // std::cout << "transformLiquids(): loopmax initial="
1642
- // << loop_max * m_transforming_liquid_loop_count_multiplier;
1639
+ #if 0
1643
1640
1644
- // If liquid_loop_max is not keeping up with the queue size increase
1645
- // loop_max up to a maximum of liquid_loop_max * dedicated_server_step.
1641
+ /* If liquid_loop_max is not keeping up with the queue size increase
1642
+ * loop_max up to a maximum of liquid_loop_max * dedicated_server_step.
1643
+ */
1646
1644
if (m_transforming_liquid.size() > loop_max * 2) {
1647
1645
// "Burst" mode
1648
1646
float server_step = g_settings->getFloat("dedicated_server_step");
@@ -1653,9 +1651,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
1653
1651
}
1654
1652
1655
1653
loop_max *= m_transforming_liquid_loop_count_multiplier;
1656
-
1657
- // std::cout << " queue sz=" << m_transforming_liquid.size()
1658
- // << " loop_max=" << loop_max;
1654
+ #endif
1659
1655
1660
1656
while (m_transforming_liquid.size () != 0 )
1661
1657
{
@@ -1913,9 +1909,17 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
1913
1909
updateLighting (lighting_modified_blocks, modified_blocks);
1914
1910
1915
1911
1916
- /*
1917
- * Queue size limiting
1912
+ /* ----------------------------------------------------------------------
1913
+ * Manage the queue so that it does not grow indefinately
1918
1914
*/
1915
+ u16 time_until_purge = g_settings->getU16 (" liquid_queue_purge_time" );
1916
+
1917
+ if (time_until_purge == 0 )
1918
+ return ; // Feature disabled
1919
+
1920
+ time_until_purge *= 1000 ; // seconds -> milliseconds
1921
+
1922
+ u32 curr_time = getTime (PRECISION_MILLI);
1919
1923
u32 prev_unprocessed = m_unprocessed_count;
1920
1924
m_unprocessed_count = m_transforming_liquid.size ();
1921
1925
@@ -1928,13 +1932,6 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
1928
1932
m_queue_size_timer_started = true ;
1929
1933
}
1930
1934
1931
- u16 time_until_purge = g_settings->getU16 (" liquid_queue_purge_time" );
1932
- time_until_purge *= 1000 ; // seconds -> milliseconds
1933
-
1934
- // std::cout << " growing for: "
1935
- // << (m_queue_size_timer_started ? curr_time - m_inc_trend_up_start_time : 0)
1936
- // << "ms" << std::endl;
1937
-
1938
1935
// Account for curr_time overflowing
1939
1936
if (m_queue_size_timer_started && m_inc_trending_up_start_time > curr_time)
1940
1937
m_queue_size_timer_started = false ;
0 commit comments