Merge remote-tracking branch 'upstream/master'

This commit is contained in:
dP
2023-04-11 00:02:31 +04:00
89 changed files with 1009 additions and 521 deletions
+2 -2
View File
@@ -257,7 +257,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 = action_cost < Company::GetIfValid(_local_company)->money;
bool affordable = Company::IsValidID(_local_company) && action_cost < Company::Get(_local_company)->money;
SetDParam(0, action_cost);
DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect),
@@ -325,7 +325,7 @@ public:
}
/* When double-clicking, continue */
if (click_count == 1 || y < 0) break;
if (click_count == 1 || y < 0 || !HasBit(this->available_actions, y)) break;
FALLTHROUGH;
}