From baaab310febf36d9d112bacd477136a7ff6b443b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 23 Aug 2025 01:01:06 +0200 Subject: [PATCH] Use stable sort in HUD rendering --- src/client/hud.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/hud.cpp b/src/client/hud.cpp index 6e3a72966..a29cc50d4 100644 --- a/src/client/hud.cpp +++ b/src/client/hud.cpp @@ -363,7 +363,8 @@ void Hud::drawLuaElements(const v3s16 &camera_offset) } // Reorder by Z-index for rendering - std::sort(elems.begin(), elems.end(), [] (HudElement *l, HudElement *r) { + // Note: we don't guarantee rendering in ID order, but it used to work so let's keep it. + std::stable_sort(elems.begin(), elems.end(), [] (HudElement *l, HudElement *r) { return l->z_index < r->z_index; });