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

Method setLiquid

source/game/StarWorldServer.cpp:1809–1821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1807}
1808
1809void WorldServer::setLiquid(Vec2I const& pos, LiquidId liquid, float level, float pressure) {
1810 if (ServerTile* tile = m_tileArray->modifyTile(pos)) {
1811 if (liquid == EmptyLiquidId)
1812 level = 0;
1813
1814 if (auto netUpdate = tile->liquid.update(liquid, level, pressure)) {
1815 for (auto const& pair : m_clientInfo) {
1816 if (pair.second->activeSectors.contains(m_tileArray->sectorFor(pos)))
1817 pair.second->pendingLiquidUpdates.add(pos);
1818 }
1819 }
1820 }
1821}
1822
1823List<ItemDescriptor> WorldServer::destroyBlock(TileLayer layer, Vec2I const& pos, bool genItems, bool destroyModFirst, bool updateNeighbors) {
1824 auto materialDatabase = Root::singleton().materialDatabase();

Callers

nothing calls this directly

Calls 5

modifyTileMethod · 0.45
updateMethod · 0.45
containsMethod · 0.45
sectorForMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected