| 1429 | } |
| 1430 | |
| 1431 | Set<Vec2I> WorldGenerator::caveLiquidSeeds(WorldStorage* worldStorage, ServerTileSectorArray::Sector const& sector) { |
| 1432 | RectI sectorTiles = worldStorage->tileArray()->sectorRegion(sector); |
| 1433 | auto samplePoint = sectorTiles.center(); |
| 1434 | auto blockInfo = m_worldServer->worldTemplate()->blockInfo(samplePoint[0], samplePoint[1]); |
| 1435 | float seedDensity = blockInfo.caveLiquidSeedDensity; |
| 1436 | Set<Vec2I> nodes; |
| 1437 | if (seedDensity > 0) { |
| 1438 | int frequency = int(100 / seedDensity); |
| 1439 | for (int y = frequency * floor(sectorTiles.min()[1] / frequency); y < sectorTiles.max()[1]; y += frequency) { |
| 1440 | for (int x = frequency * floor(sectorTiles.min()[0] / frequency); x < sectorTiles.max()[0]; x += frequency) { |
| 1441 | if (sectorTiles.contains(Vec2I(x, y))) |
| 1442 | nodes.add(Vec2I(x, y)); |
| 1443 | } |
| 1444 | } |
| 1445 | } |
| 1446 | return nodes; |
| 1447 | } |
| 1448 | |
| 1449 | Map<Vec2I, float> WorldGenerator::determineLiquidLevel(Set<Vec2I> const& spots, Set<Vec2I> const& filled) { |
| 1450 | Set<Vec2I> openSet(spots); |
nothing calls this directly
no test coverage detected