Skip to content

Commit f2d87fd

Browse files
authored
Fix missing scrollbar in world mod selection dialog
Fixes a regression introduced by 3b67e73.
1 parent 4ba41c2 commit f2d87fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gui/guiFormSpecMenu.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,11 +3360,14 @@ void GUIFormSpecMenu::legacySortElements(std::list<IGUIElement *>::iterator from
33603360
// TODO: getSpecByID is a linear search. It should made O(1), or cached here.
33613361
const FieldSpec *spec_a = getSpecByID(a->getID());
33623362
const FieldSpec *spec_b = getSpecByID(b->getID());
3363-
// Have to be deterministic also for elements without spec
3363+
// The comparison has to be compatible with strict weak ordering
33643364
if (spec_a && spec_b)
33653365
return spec_a->priority < spec_b->priority;
33663366

3367-
return a->getID() < b->getID();
3367+
if (spec_a && !spec_b)
3368+
return true;
3369+
3370+
return false;
33683371
});
33693372

33703373
// 3: Re-assign the pointers

0 commit comments

Comments
 (0)