diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-16 20:38:44 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-16 20:38:44 +0200 |
commit | c51564ab5b97e0b603de5413bd28aa1f729de5ba (patch) | |
tree | 676ff4ccd4a8b1e6573278082cc07b8e26c75385 /src | |
parent | 1eb14c7743dc73bd43eaf39f891105bfa741a458 (diff) | |
download | minetest-c51564ab5b97e0b603de5413bd28aa1f729de5ba.tar.gz minetest-c51564ab5b97e0b603de5413bd28aa1f729de5ba.tar.bz2 minetest-c51564ab5b97e0b603de5413bd28aa1f729de5ba.zip |
Optimize for viscosity 1
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index 6331055aa..f5c4a5e02 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -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 // must be at least 1 in absolute value s8 level_inc = max_node_level - liquid_level; - u8 viscosity = content_features(liquid_kind).liquid_viscosity; if (level_inc < -viscosity || level_inc > viscosity) new_node_level = liquid_level + level_inc/viscosity; else if (level_inc < 0) |