mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
VCAI compareArtifacts: consider that art with highest price is best
That is suboptimal way as well, but let us avoid infinite loop there. Fix issue 2461
This commit is contained in:
@@ -509,8 +509,10 @@ bool compareArtifacts(const CArtifactInstance *a1, const CArtifactInstance *a2)
|
|||||||
auto art1 = a1->artType;
|
auto art1 = a1->artType;
|
||||||
auto art2 = a2->artType;
|
auto art2 = a2->artType;
|
||||||
|
|
||||||
if (art1->valOfBonuses(Bonus::PRIMARY_SKILL) > art2->valOfBonuses(Bonus::PRIMARY_SKILL))
|
if(art1->price == art2->price)
|
||||||
|
return art1->valOfBonuses(Bonus::PRIMARY_SKILL) > art2->valOfBonuses(Bonus::PRIMARY_SKILL);
|
||||||
|
else if(art1->price > art2->price)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return art1->price > art2->price;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user