1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-16 18:05:22 +02:00

MapBlock::getData be gone (#16292)

* Remove Mapblock::getData and all its uses

* Do not leak ystride, zstride, and nodecount
This commit is contained in:
lhofhansl
2025-06-29 13:36:47 -07:00
committed by GitHub
parent fd0ca20ce9
commit 43aad3711b
4 changed files with 33 additions and 21 deletions

View File

@@ -31,9 +31,11 @@ public:
for (s16 y = bpmin.Y; y <= bpmax.Y; y++) {
MapBlock *block = getBlockNoCreateNoEx({x, y, z});
if (block) {
auto *data = block->getData();
for (size_t i = 0; i < MapBlock::nodecount; i++)
data[i] = n;
for (s16 zn=0; zn < MAP_BLOCKSIZE; zn++)
for (s16 yn=0; yn < MAP_BLOCKSIZE; yn++)
for (s16 xn=0; xn < MAP_BLOCKSIZE; xn++) {
block->setNodeNoCheck(xn, yn, zn, n);
}
block->expireIsAirCache();
}
}