Merge branch 'master' into jgrpp

# Conflicts:
#	src/cheat_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/company_base.h
#	src/debug.cpp
#	src/debug.h
#	src/economy.cpp
#	src/engine_type.h
#	src/graph_gui.cpp
#	src/misc_cmd.cpp
#	src/misc_cmd.h
#	src/network/core/os_abstraction.cpp
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/settings_type.h
#	src/ship_cmd.cpp
#	src/stdafx.h
#	src/tests/bitmath_func.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-17 11:53:23 +00:00
66 changed files with 554 additions and 234 deletions

View File

@@ -373,9 +373,11 @@ struct CompanyFinancesWindow : Window {
SetDParam(0, _settings_game.difficulty.initial_interest);
break;
case WID_CF_MAXLOAN_VALUE:
SetDParam(0, _economy.max_loan);
case WID_CF_MAXLOAN_VALUE: {
const Company *c = Company::Get((CompanyID)this->window_number);
SetDParam(0, c->GetMaxLoan());
break;
}
case WID_CF_INCREASE_LOAN:
case WID_CF_REPAY_LOAN:
@@ -473,7 +475,7 @@ struct CompanyFinancesWindow : Window {
}
const Company *c = Company::Get(company);
this->SetWidgetDisabledState(WID_CF_INCREASE_LOAN, c->current_loan == _economy.max_loan); // Borrow button only shows when there is any more money to loan.
this->SetWidgetDisabledState(WID_CF_INCREASE_LOAN, c->current_loan >= c->GetMaxLoan()); // Borrow button only shows when there is any more money to loan.
this->SetWidgetDisabledState(WID_CF_REPAY_LOAN, company != _local_company || c->current_loan == 0); // Repay button only shows when there is any more money to repay.
}