mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Add a setting for max loop count per step in liquid update
This commit is contained in:
parent
c2cdaceed0
commit
b1ebd9f79c
@ -93,11 +93,17 @@
|
|||||||
#new_style_water = false
|
#new_style_water = false
|
||||||
# Constant volume liquids
|
# Constant volume liquids
|
||||||
#liquid_finite = false
|
#liquid_finite = false
|
||||||
|
# Max liquids processed per step
|
||||||
|
#liquid_loop_max = 1000
|
||||||
# Update liquids every .. recommend for finite: 0.2
|
# Update liquids every .. recommend for finite: 0.2
|
||||||
#liquid_update = 1.0
|
#liquid_update = 1.0
|
||||||
# When finite liquid: relax flowing blocks to source if level near max and N nearby source blocks, more realistic, but not true constant. values: 0,1,2,3,4 : 0 - disable, 1 - most aggresive
|
# Relax flowing blocks to source if level near max and N nearby
|
||||||
|
# source blocks, more realistic, but not true constant.
|
||||||
|
# values: 0,1,2,3,4 : 0 - disable, 1 - most aggresive
|
||||||
|
# (for finite liquids)
|
||||||
#liquid_relax = 2
|
#liquid_relax = 2
|
||||||
# Optimization: faster cave flood (and not true constant)
|
# Optimization: faster cave flood (and not true constant)
|
||||||
|
# (for finite liquids)
|
||||||
#liquid_fast_flood = 1
|
#liquid_fast_flood = 1
|
||||||
# Underground water and lava springs, its infnity sources if liquid_finite enabled
|
# Underground water and lava springs, its infnity sources if liquid_finite enabled
|
||||||
#underground_springs = 1
|
#underground_springs = 1
|
||||||
|
@ -209,6 +209,7 @@ void set_default_settings(Settings *settings)
|
|||||||
|
|
||||||
//liquid stuff
|
//liquid stuff
|
||||||
settings->setDefault("liquid_finite", "false");
|
settings->setDefault("liquid_finite", "false");
|
||||||
|
settings->setDefault("liquid_loop_max", "1000");
|
||||||
settings->setDefault("liquid_update", "1.0");
|
settings->setDefault("liquid_update", "1.0");
|
||||||
settings->setDefault("liquid_relax", "2");
|
settings->setDefault("liquid_relax", "2");
|
||||||
settings->setDefault("liquid_fast_flood", "1");
|
settings->setDefault("liquid_fast_flood", "1");
|
||||||
|
@ -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)
|
// List of MapBlocks that will require a lighting update (due to lava)
|
||||||
std::map<v3s16, MapBlock*> lighting_modified_blocks;
|
std::map<v3s16, MapBlock*> lighting_modified_blocks;
|
||||||
|
|
||||||
|
u16 loop_max = g_settings->getU16("liquid_loop_max");
|
||||||
|
|
||||||
while (m_transforming_liquid.size() > 0)
|
while (m_transforming_liquid.size() > 0)
|
||||||
{
|
{
|
||||||
// This should be done here so that it is done when continue is used
|
// 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;
|
break;
|
||||||
loopcount++;
|
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)
|
// List of MapBlocks that will require a lighting update (due to lava)
|
||||||
std::map<v3s16, MapBlock*> lighting_modified_blocks;
|
std::map<v3s16, MapBlock*> lighting_modified_blocks;
|
||||||
|
|
||||||
|
u16 loop_max = g_settings->getU16("liquid_loop_max");
|
||||||
|
|
||||||
while(m_transforming_liquid.size() != 0)
|
while(m_transforming_liquid.size() != 0)
|
||||||
{
|
{
|
||||||
// This should be done here so that it is done when continue is used
|
// 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;
|
break;
|
||||||
loopcount++;
|
loopcount++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user