Skip to content

Commit

Permalink
Fix GTU calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdimura committed Jan 10, 2021
1 parent bdec149 commit e7c9efe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Galaxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,9 @@ unsigned Galaxy::galaxyTechLevel() const
auto maxPtlIt = std::find_if(ptlCount.rbegin(), ptlCount.rend(),
[](const int &c) { return c > 0; });
unsigned maxPtl = std::distance(maxPtlIt, ptlCount.rend());
if (ptlCount[maxPtl] == 5) {
if (ptlCount[maxPtl] >= 5) {
return maxPtl;
}
if (ptlCount[maxPtl] == 2 || ptlCount[maxPtl - 1] == 4) {
} else if (ptlCount[maxPtl] >= 2 || ptlCount[maxPtl - 1] >= 4) {
return maxPtl - 1;
}
return maxPtl - 2;
Expand Down

0 comments on commit e7c9efe

Please sign in to comment.