@@ -2136,6 +2136,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
2136
2136
content_t new_node_content;
2137
2137
s8 new_node_level = -1 ;
2138
2138
s8 max_node_level = -1 ;
2139
+ u8 range = rangelim (nodemgr->get (liquid_kind).liquid_range , 0 , LIQUID_LEVEL_MAX+1 );
2139
2140
if ((num_sources >= 2 && nodemgr->get (liquid_kind).liquid_renewable ) || liquid_type == LIQUID_SOURCE) {
2140
2141
// liquid_kind will be set to either the flowing alternative of the node (if it's a liquid)
2141
2142
// or the flowing alternative of the first of the surrounding sources (if it's air), so
@@ -2145,6 +2146,8 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
2145
2146
// liquid_kind is set properly, see above
2146
2147
new_node_content = liquid_kind;
2147
2148
max_node_level = new_node_level = LIQUID_LEVEL_MAX;
2149
+ if (new_node_level < (LIQUID_LEVEL_MAX+1 -range))
2150
+ new_node_content = CONTENT_AIR;
2148
2151
} else {
2149
2152
// no surrounding sources, so get the maximum level that can flow into this node
2150
2153
for (u16 i = 0 ; i < num_flows; i++) {
@@ -2185,8 +2188,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
2185
2188
} else
2186
2189
new_node_level = max_node_level;
2187
2190
2188
- u8 range = rangelim (nodemgr->get (liquid_kind).liquid_range , 0 , LIQUID_LEVEL_MAX+1 );
2189
- if (new_node_level >= (LIQUID_LEVEL_MAX+1 -range))
2191
+ if (max_node_level >= (LIQUID_LEVEL_MAX+1 -range))
2190
2192
new_node_content = liquid_kind;
2191
2193
else
2192
2194
new_node_content = CONTENT_AIR;
0 commit comments