1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Move hard coded minimap to builtin (#14071)

This commit is contained in:
cx384 2024-02-07 20:13:23 +01:00 committed by GitHub
parent f2b99332d9
commit adaa4cc2f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 51 additions and 87 deletions

View file

@ -340,6 +340,14 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
std::vector<HudElement*> elems;
elems.reserve(player->maxHudId());
// Add builtin minimap if the server doesn't send it.
HudElement minimap;
if (client->getProtoVersion() < 44 && (player->hud_flags & HUD_FLAG_MINIMAP_VISIBLE)) {
minimap = {HUD_ELEM_MINIMAP, v2f(1, 0), "", v2f(), "", 0 , 0, 0, v2f(-1, 1),
v2f(-10, 10), v3f(), v2s32(256, 256), 0, "", 0};
elems.push_back(&minimap);
}
for (size_t i = 0; i != player->maxHudId(); i++) {
HudElement *e = player->getHud(i);
if (!e)