1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Remove unused MapBlock functionality

This commit is contained in:
Jude Melton-Houghton 2022-10-05 07:55:33 -04:00
parent 7a28f2c4fa
commit 8f996e4a7c
9 changed files with 110 additions and 250 deletions

View file

@ -85,13 +85,12 @@ inline MapBlock *ReflowScan::lookupBlock(int x, int y, int z)
inline bool ReflowScan::isLiquidFlowableTo(int x, int y, int z)
{
// Tests whether (x,y,z) is a node to which liquid might flow.
bool valid_position;
MapBlock *block = lookupBlock(x, y, z);
if (block) {
int dx = (MAP_BLOCKSIZE + x) % MAP_BLOCKSIZE;
int dy = (MAP_BLOCKSIZE + y) % MAP_BLOCKSIZE;
int dz = (MAP_BLOCKSIZE + z) % MAP_BLOCKSIZE;
MapNode node = block->getNodeNoCheck(dx, dy, dz, &valid_position);
MapNode node = block->getNodeNoCheck(dx, dy, dz);
if (node.getContent() != CONTENT_IGNORE) {
const ContentFeatures &f = m_ndef->get(node);
// NOTE: No need to check for flowing nodes with lower liquid level
@ -115,8 +114,6 @@ inline bool ReflowScan::isLiquidHorizontallyFlowable(int x, int y, int z)
void ReflowScan::scanColumn(int x, int z)
{
bool valid_position;
// Is the column inside a loaded block?
MapBlock *block = lookupBlock(x, 0, z);
if (!block)
@ -129,7 +126,7 @@ void ReflowScan::scanColumn(int x, int z)
// Get the state from the node above the scanned block
bool was_ignore, was_liquid;
if (above) {
MapNode node = above->getNodeNoCheck(dx, 0, dz, &valid_position);
MapNode node = above->getNodeNoCheck(dx, 0, dz);
was_ignore = node.getContent() == CONTENT_IGNORE;
was_liquid = m_ndef->get(node).isLiquid();
} else {
@ -141,7 +138,7 @@ void ReflowScan::scanColumn(int x, int z)
// Scan through the whole block
for (s16 y = MAP_BLOCKSIZE - 1; y >= 0; y--) {
MapNode node = block->getNodeNoCheck(dx, y, dz, &valid_position);
MapNode node = block->getNodeNoCheck(dx, y, dz);
const ContentFeatures &f = m_ndef->get(node);
bool is_ignore = node.getContent() == CONTENT_IGNORE;
bool is_liquid = f.isLiquid();
@ -179,7 +176,7 @@ void ReflowScan::scanColumn(int x, int z)
// Check the node below the current block
MapBlock *below = lookupBlock(x, -1, z);
if (below) {
MapNode node = below->getNodeNoCheck(dx, MAP_BLOCKSIZE - 1, dz, &valid_position);
MapNode node = below->getNodeNoCheck(dx, MAP_BLOCKSIZE - 1, dz);
const ContentFeatures &f = m_ndef->get(node);
bool is_ignore = node.getContent() == CONTENT_IGNORE;
bool is_liquid = f.isLiquid();