mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add a setting for max loop count per step in liquid update
This commit is contained in:
parent
c2cdaceed0
commit
b1ebd9f79c
3 changed files with 14 additions and 3 deletions
|
@ -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++;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue