- // Move air bubble if not taking water from ocean
- if(from_ocean == false)
- {
- m_data[m_area.index(p)].d = m_data[m_area.index(removed_pos)].d;
- m_flags[m_area.index(p)] = m_flags[m_area.index(removed_pos)];
- }
-
- /*
- This has to be done to copy the brightness of a light source
- correctly. Otherwise unspreadLight will fuck up when water
- has replaced a light source.
- */
- u8 light = m_data[m_area.index(removed_pos)].getLight();
-
- m_data[m_area.index(removed_pos)].d = m;
- m_flags[m_area.index(removed_pos)] = f;
-
- m_data[m_area.index(removed_pos)].setLight(light);
-
- /*// NOTE: HACK: This has to be set to LIGHT_MAX so that
- // unspreadLight will clear all light that came from this node.
- // Otherwise there will be weird bugs
- m_data[m_area.index(removed_pos)].setLight(LIGHT_MAX);*/
-
- // Mark removed_pos checked
- m_flags[m_area.index(removed_pos)] |= VOXELFLAG_CHECKED;
-
- // If block was dropped from surface, increase pressure
- if(i == 0 && m_data[m_area.index(removed_pos)].pressure == 1)
- {
- m_data[m_area.index(removed_pos)].pressure = 2;
- }
-
- /*
- NOTE: This does not work as-is
- if(m == CONTENT_OCEAN)
- {
- // If block was raised to surface, increase pressure of
- // source node
- if(i == 5 && m_data[m_area.index(p)].pressure == 1)
- {
- m_data[m_area.index(p)].pressure = 2;
- }
- }*/
-
- /*if(debugprint)
- {
- dstream<<"VoxelManipulator::flowWater(): Moved bubble:"<<std::endl;
- print(dstream, VOXELPRINT_WATERPRESSURE);
- }*/
-
- // Update pressure
- VoxelArea a;
- a.addPoint(p - v3s16(1,1,1));
- a.addPoint(p + v3s16(1,1,1));
- a.addPoint(removed_pos - v3s16(1,1,1));
- a.addPoint(removed_pos + v3s16(1,1,1));
- updateAreaWaterPressure(a, active_nodes);
-
- /*if(debugprint)
- {
- dstream<<"VoxelManipulator::flowWater(): Pressure updated:"<<std::endl;
- print(dstream, VOXELPRINT_WATERPRESSURE);
- //std::cin.get();
- }*/