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

Add C++-side unit tests for MMVManip

This commit is contained in:
sfan5 2025-05-25 13:31:16 +02:00
parent e03957ec0c
commit 41651c7317
3 changed files with 89 additions and 44 deletions

View file

@ -27,12 +27,13 @@ public:
void fill(v3s16 bpmin, v3s16 bpmax, MapNode n)
{
for (s16 z = bpmin.Z; z <= bpmax.Z; z++)
for (s16 y = bpmin.Y; y <= bpmax.Y; y++)
for (s16 x = bpmin.X; x <= bpmax.X; x++) {
for (s16 x = bpmin.X; x <= bpmax.X; x++)
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++)
block->getData()[i] = n;
data[i] = n;
block->expireIsAirCache();
}
}