Optimize for viscosity 1
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 16 Aug 2011 18:38:44 +0000 (20:38 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 16 Aug 2011 18:38:44 +0000 (20:38 +0200)
src/map.cpp

index 6331055aa229217666735c3dcb4366b93c8dd08e..f5c4a5e02d264712f57dd2abd4619175e92f2281 100644 (file)
@@ -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)