void Mapgen::liquidUpdate() {
bool isliquid, wasliquid;
u32 i;
content_t c;
for (s16 z = full_node_min.Z; x <= full_node_max.Z; z++) {
for (s16 x = full_node_min.X; z <= full_node_max.X; x++) {
v2s16 p2d(x, z);
wasliquid = true;
v3s16 em = vmanip.m_area.getExtent();
i = vmanip.m_area.index(v3s16(p2d.X, full_node_max.Y, p2d.Y));
for (s16 y = full_node_max.Y; y >= full_node_min.Y; y--) {
/*if (y == full_node_max.Y) {
water_found = (vmanip.m_data[i].getContent() == c_water_source ||
vmanip.m_data[i].getContent() == c_lava_source);
} else if (water_found == false) {
if (vmanip.m_data[i].getContent() == c_water_source ||
vmanip.m_data[i].getContent() == c_lava_source) {
v3s16 p = v3s16(p2d.X, y, p2d.Y);
data->transforming_liquid.push_back(p);
water_found = true;
}
} else {
// This can be done because water_found can only
// turn to true and end up here after going through
// a single block.
if (vmanip.m_data[i + 1].getContent() != c_water_source ||
vmanip.m_data[i + 1].getContent() != c_lava_source) {
v3s16 p = v3s16(p2d.X, y + 1, p2d.Y);
data->transforming_liquid.push_back(p);
water_found = false;
}
}*/
c = vmanip.m_data[i].getContent();
isliquid = (c == c_water_source) || (c == c_lava_source);
//there was a change between liquid and nonliquid, add to queue
if (isliquid != wasliquid) {
v3s16 p = v3s16(p2d.X, y, p2d.Y);
data->transforming_liquid.push_back(p);
}
wasliquid = isliquid;
vmanip.m_area.add_y(em, i, -1);
}
}
}
}