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

(cherry picked from commit 21813fbe8b)
This commit is contained in:
Patric Stout 2024-06-26 16:19:53 +02:00 committed by Jonathan G Rennison
parent 436178cbd4
commit 4f58a0f3c5

View File

@ -209,7 +209,7 @@ Money CalculateHostileTakeoverValue(const Company *c)
} }
for (int quarter = 0; quarter < 4; quarter++) { 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); return std::max<Money>(value, 1);