1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00

Update client/windows/CCreatureWindow.cpp

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
Laserlicht 2024-11-13 20:03:20 +01:00 committed by GitHub
parent 988d36bd13
commit e73cb7f45b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -830,7 +830,10 @@ void CStackWindow::initBonusesList()
BonusList input;
input = *(info->stackNode->getBonuses(CSelector(Bonus::Permanent), Selector::all));
std::sort(input.begin(), input.end(), [this](std::shared_ptr<Bonus> v1, std::shared_ptr<Bonus> & v2){
return v1->source == v2->source ? info->stackNode->bonusToString(v1, false) < info->stackNode->bonusToString(v2, false) : v1->source == BonusSource::CREATURE_ABILITY || (v1->source < v2->source);
if (v1->source != v2->source)
return v1->source == BonusSource::CREATURE_ABILITY || (v1->source < v2->source);
else
return info->stackNode->bonusToString(v1, false) < info->stackNode->bonusToString(v2, false);
});
while(!input.empty())