1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make minimap respect drawtype = "airlike" (#16251)

This commit is contained in:
Xeno333 2025-06-13 16:33:10 -05:00 committed by GitHub
parent f75d16c1e6
commit 225d2cf916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -626,7 +626,7 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data):
if (data->m_vmanip.getNodeNoEx(p).getContent() != CONTENT_IGNORE) { if (data->m_vmanip.getNodeNoEx(p).getContent() != CONTENT_IGNORE) {
MinimapMapblock *block = new MinimapMapblock; MinimapMapblock *block = new MinimapMapblock;
m_minimap_mapblocks[mesh_grid.getOffsetIndex(ofs)] = block; m_minimap_mapblocks[mesh_grid.getOffsetIndex(ofs)] = block;
block->getMinimapNodes(&data->m_vmanip, p); block->getMinimapNodes(&data->m_vmanip, data->m_nodedef, p);
} }
} }
} }

View file

@ -713,9 +713,8 @@ void Minimap::updateActiveMarkers()
//// MinimapMapblock //// MinimapMapblock
//// ////
void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, const v3s16 &pos) void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, const NodeDefManager *nodedef, const v3s16 &pos)
{ {
for (s16 x = 0; x < MAP_BLOCKSIZE; x++) for (s16 x = 0; x < MAP_BLOCKSIZE; x++)
for (s16 z = 0; z < MAP_BLOCKSIZE; z++) { for (s16 z = 0; z < MAP_BLOCKSIZE; z++) {
s16 air_count = 0; s16 air_count = 0;
@ -725,11 +724,12 @@ void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, const v3s16 &pos
for (s16 y = MAP_BLOCKSIZE -1; y >= 0; y--) { for (s16 y = MAP_BLOCKSIZE -1; y >= 0; y--) {
v3s16 p(x, y, z); v3s16 p(x, y, z);
MapNode n = vmanip->getNodeNoEx(pos + p); MapNode n = vmanip->getNodeNoEx(pos + p);
if (!surface_found && n.getContent() != CONTENT_AIR) { const ContentFeatures &f = nodedef->get(n);
if (!surface_found && f.drawtype != NDT_AIRLIKE) {
mmpixel->height = y; mmpixel->height = y;
mmpixel->n = n; mmpixel->n = n;
surface_found = true; surface_found = true;
} else if (n.getContent() == CONTENT_AIR) { } else if (f.drawtype == NDT_AIRLIKE) {
air_count++; air_count++;
} }
} }

View file

@ -66,7 +66,7 @@ struct MinimapPixel {
}; };
struct MinimapMapblock { struct MinimapMapblock {
void getMinimapNodes(VoxelManipulator *vmanip, const v3s16 &pos); void getMinimapNodes(VoxelManipulator *vmanip, const NodeDefManager *nodedef, const v3s16 &pos);
MinimapPixel data[MAP_BLOCKSIZE * MAP_BLOCKSIZE]; MinimapPixel data[MAP_BLOCKSIZE * MAP_BLOCKSIZE];
}; };