Changeset - r26865:4be9b9bf170a
[Not reviewed]
master
0 1 0
glx22 - 19 months ago 2023-02-10 01:15:50
glx@openttd.org
Fix #10461, 59645c6: Properly check for _local_company validity
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/town_gui.cpp
Show inline comments
 
@@ -229,7 +229,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),
0 comments (0 inline, 0 general)