Optimize for viscosity 1
parent
1eb14c7743
commit
c51564ab5b
|
@ -1708,11 +1708,11 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_node_level != liquid_level) {
|
u8 viscosity = content_features(liquid_kind).liquid_viscosity;
|
||||||
|
if (viscosity > 1 && max_node_level != liquid_level) {
|
||||||
// amount to gain, limited by viscosity
|
// amount to gain, limited by viscosity
|
||||||
// must be at least 1 in absolute value
|
// must be at least 1 in absolute value
|
||||||
s8 level_inc = max_node_level - liquid_level;
|
s8 level_inc = max_node_level - liquid_level;
|
||||||
u8 viscosity = content_features(liquid_kind).liquid_viscosity;
|
|
||||||
if (level_inc < -viscosity || level_inc > viscosity)
|
if (level_inc < -viscosity || level_inc > viscosity)
|
||||||
new_node_level = liquid_level + level_inc/viscosity;
|
new_node_level = liquid_level + level_inc/viscosity;
|
||||||
else if (level_inc < 0)
|
else if (level_inc < 0)
|
||||||
|
|
Loading…
Reference in New Issue