This commit is contained in:
@@ -178,6 +178,8 @@
|
|||||||
{
|
{
|
||||||
company = ResolveCompanyID(company);
|
company = ResolveCompanyID(company);
|
||||||
if (company == COMPANY_INVALID) return -1;
|
if (company == COMPANY_INVALID) return -1;
|
||||||
|
/* If we return INT64_MAX as usual, overflows may occur in the script. So return a smaller value. */
|
||||||
|
if (_settings_game.difficulty.infinite_money) return INT32_MAX;
|
||||||
|
|
||||||
return GetAvailableMoney((::CompanyID)company);
|
return GetAvailableMoney((::CompanyID)company);
|
||||||
}
|
}
|
||||||
|
@@ -258,9 +258,10 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the bank balance. In other words, the amount of money the given company can spent.
|
* Gets the bank balance. In other words, the amount of money the given company can spent.
|
||||||
|
* If infinite money is enabled, it returns INT32_MAX.
|
||||||
* @param company The company to get the bank balance of.
|
* @param company The company to get the bank balance of.
|
||||||
* @pre ResolveCompanyID(company) != COMPANY_INVALID.
|
* @pre ResolveCompanyID(company) != COMPANY_INVALID.
|
||||||
* @return The actual bank balance.
|
* @return The actual bank balance or INT32_MAX.
|
||||||
*/
|
*/
|
||||||
static Money GetBankBalance(CompanyID company);
|
static Money GetBankBalance(CompanyID company);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user