MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / drainLevel

Method drainLevel

source/game/StarWorldGeneration.cpp:44–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44float LiquidWorld::drainLevel(Vec2I const& location) const {
45 if (location[1] > m_worldServer->worldTemplate()->undergroundLevel()) {
46 auto const& tile = m_worldServer->getServerTile(location);
47 if (!m_materialDatabase->blocksLiquidFlow(tile.background)) {
48 auto const& belowTile = m_worldServer->getServerTile(location + Vec2I(0, -1));
49 if (m_materialDatabase->blocksLiquidFlow(belowTile.background) || m_materialDatabase->blocksLiquidFlow(belowTile.foreground) || belowTile.liquid.source)
50 return m_liquidsDatabase->backgroundDrain();
51 }
52 }
53 return 0.0f;
54}
55
56CellularLiquidCell<LiquidId> LiquidWorld::cell(Vec2I const& location) const {
57 auto const& tile = m_worldServer->getServerTile(location);

Callers

nothing calls this directly

Calls 4

undergroundLevelMethod · 0.80
worldTemplateMethod · 0.80
blocksLiquidFlowMethod · 0.80
backgroundDrainMethod · 0.80

Tested by

no test coverage detected