Add: [GS] Allow to set max loan for each company separately (#11224)

This commit is contained in:
dP
2024-01-30 23:45:19 +05:30
committed by GitHub
parent b370ae1212
commit 897b59c158
15 changed files with 129 additions and 20 deletions

View File

@@ -95,6 +95,16 @@ void Company::PostDestructor(size_t index)
InvalidateWindowData(WC_ERRMSG, 0);
}
/**
* Calculate the max allowed loan for this company.
* @return the max loan amount.
*/
Money Company::GetMaxLoan() const
{
if (this->max_loan == COMPANY_MAX_LOAN_DEFAULT) return _economy.max_loan;
return this->max_loan;
}
/**
* Sets the local company and updates the settings that are set on a
* per-company basis to reflect the core's state in the GUI.