Fix #12818: during Hostile Takeover, profit was calculated wrongly (#12819)

This commit is contained in:
Patric Stout 2024-06-26 16:19:53 +02:00 committed by GitHub
parent 209b0320d5
commit 21813fbe8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,7 +184,7 @@ Money CalculateHostileTakeoverValue(const Company *c)
}
for (int quarter = 0; quarter < 4; quarter++) {
value += std::max<Money>(c->old_economy[quarter].income - c->old_economy[quarter].expenses, 0) * 2;
value += std::max<Money>(c->old_economy[quarter].income + c->old_economy[quarter].expenses, 0) * 2;
}
return std::max<Money>(value, 1);