1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 19:02:41 +01:00

Fix #11938: Check infinite money setting in cases where it was missed (#11939)

This commit is contained in:
merni-ns
2024-02-01 00:41:48 +05:30
committed by GitHub
parent 363e251a10
commit ccaa383e85
4 changed files with 11 additions and 7 deletions

View File

@@ -245,7 +245,7 @@ public:
case WID_TA_ACTION_INFO:
if (this->sel_index != -1) {
Money action_cost = _price[PR_TOWN_ACTION] * _town_action_costs[this->sel_index] >> 8;
bool affordable = Company::IsValidID(_local_company) && action_cost < Company::Get(_local_company)->money;
bool affordable = Company::IsValidID(_local_company) && action_cost < GetAvailableMoney(_local_company);
SetDParam(0, action_cost);
DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect),