diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 5d29c4c74d..2b92920261 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -281,7 +281,7 @@ struct CompanyFinancesWindow : Window { CompanyFinancesWindow(WindowDesc *desc, CompanyID company) : Window(desc) { const Company *c = Company::Get(company); - this->max_money = max(c->money * 2, INT32_MAX); + this->max_money = max(abs(c->money) * 2, INT32_MAX); this->small = false; this->CreateNestedTree(); this->SetupWidgets(); @@ -460,8 +460,8 @@ struct CompanyFinancesWindow : Window { void OnHundredthTick() override { const Company *c = Company::Get((CompanyID)this->window_number); - if (c->money > this->max_money) { - this->max_money = max(c->money * 2, this->max_money * 4); + if (abs(c->money) > this->max_money) { + this->max_money = max(abs(c->money) * 2, this->max_money * 4); this->SetupWidgets(); this->ReInit(); }