AGS: Engine: fixed GUI sorting for cases when ZOrder is equal

Was broken by fcc873e
From upstream ff210b2ce50cea0e903cd1d09fa7ad1734a862b0
This commit is contained in:
Walter Agazzi 2023-03-03 01:25:23 +01:00 committed by Thierry Crozat
parent 26c2a748de
commit f0c18ccacb

View File

@ -406,9 +406,9 @@ void replace_macro_tokens(const char *text, String &fixed_text) {
}
}
bool sort_gui_less(const int g1, const int g2) {
return _GP(guis)[g1].ZOrder < _GP(guis)[g2].ZOrder;
return (_GP(guis)[g1].ZOrder < _GP(guis)[g2].ZOrder) ||
((_GP(guis)[g1].ZOrder == _GP(guis)[g2].ZOrder) && (g1 < g2));
}
void update_gui_zorder() {