From: Giuseppe Bilotta Date: Tue, 16 Aug 2011 18:38:44 +0000 (+0200) Subject: Optimize for viscosity 1 X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=c51564ab5b97e0b603de5413bd28aa1f729de5ba;p=zefram%2Fminetest%2Fminetest_engine.git Optimize for viscosity 1 --- diff --git a/src/map.cpp b/src/map.cpp index 6331055a..f5c4a5e0 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1708,11 +1708,11 @@ void Map::transformLiquids(core::map & 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)