File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 2020
2121EGameIDs ParseStringToGameType (const char * str);
2222
23- bool predicate_sort_stat (const SDrawStaticStruct* s1, const SDrawStaticStruct* s2)
24- {
25- return s1->IsActual () > s2->IsActual ();
26- }
27-
2823struct predicate_find_stat
2924{
3025 const char * id;
@@ -58,12 +53,13 @@ CUIGameCustom::~CUIGameCustom()
5853void CUIGameCustom::OnFrame ()
5954{
6055 CDialogHolder::OnFrame ();
61- auto it = CustomStatics.begin ();
62- auto it_e = CustomStatics.end ();
63- for (; it != it_e; ++it)
64- (*it)->Update ();
65- // BUG: sort is never performed here, so not all inactual items will be deleted
66- std::sort (it, it_e, predicate_sort_stat);
56+ for (auto item : CustomStatics)
57+ item->Update ();
58+ auto comparer = [](const SDrawStaticStruct* s1, const SDrawStaticStruct* s2)
59+ {
60+ return s1->IsActual () > s2->IsActual ();
61+ };
62+ std::sort (CustomStatics.begin (), CustomStatics.end (), comparer);
6763 while (!CustomStatics.empty () && !CustomStatics.back ()->IsActual ())
6864 {
6965 delete_data (CustomStatics.back ());
You can’t perform that action at this time.
0 commit comments