MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetAvailableMoney

Function GetAvailableMoney

src/company_cmd.cpp:238–243  ·  view source on GitHub ↗

* Get the amount of money that a company has available, or INT64_MAX * if there is no such valid company. * * @param company Company to check * @return The available money of the company or INT64_MAX */

Source from the content-addressed store, hash-verified

236 * @return The available money of the company or INT64_MAX
237 */
238Money GetAvailableMoney(CompanyID company)
239{
240 if (_settings_game.difficulty.infinite_money) return INT64_MAX;
241 if (!Company::IsValidID(company)) return INT64_MAX;
242 return Company::Get(company)->money;
243}
244
245/**
246 * This functions returns the money which can be used to execute a command.

Callers 6

DrawWidgetMethod · 0.85
NeedsServicingMethod · 0.85
CompaniesPayInterestFunction · 0.85
GetMaskOfTownActionsFunction · 0.85
GetBankBalanceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected