8000 Make minimap respect `drawtype = "airlike"` by Xeno333 · Pull Request #16251 · luanti-org/luanti · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make minimap respect drawtype = "airlike" #16251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/mapblock_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data):
if (data->m_vmanip.getNodeNoEx(p).getContent() != CONTENT_IGNORE) {
MinimapMapblock *block = new MinimapMapblock;
m_minimap_mapblocks[mesh_grid.getOffsetIndex(ofs)] = block;
block->getMinimapNodes(&data->m_vmanip, p);
block->getMinimapNodes(&data->m_vmanip, data->m_nodedef, p);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/client/minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,8 @@ void Minimap::updateActiveMarkers()
//// 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 z = 0; z < MAP_BLOCKSIZE; z++) {
s16 air_count = 0;
Expand All @@ -725,11 +724,12 @@ void MinimapMapblock::getMinimapNodes(VoxelManipulator *vmanip, const v3s16 &pos
for (s16 y = MAP_BLOCKSIZE -1; y >= 0; y--) {
v3s16 p(x, y, z);
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->n = n;
surface_found = true;
} else if (n.getContent() == CONTENT_AIR) {
} else if (f.drawtype == NDT_AIRLIKE) {
air_count++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/minimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct MinimapPixel {
};

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];
};
Expand Down
Loading
0