Fix crash when sorting by capacity in autoreplace window

Move capacity cache into GUIList sort parameter

See: #690
This commit is contained in:
Jonathan G Rennison
2024-05-07 17:41:37 +01:00
parent 5e24882c18
commit 6d4f616706
4 changed files with 107 additions and 96 deletions

View File

@@ -32,7 +32,7 @@
void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList &eng_list, const Scrollbar &sb, EngineID selected_id, bool show_count, GroupID selected_group);
static bool EngineNumberSorter(const GUIEngineListItem &a, const GUIEngineListItem &b)
static bool EngineNumberSorter(const GUIEngineListItem &a, const GUIEngineListItem &b, const GUIEngineListSortCache &cache)
{
return Engine::Get(a.engine_id)->list_position < Engine::Get(b.engine_id)->list_position;
}