Fix not being able to build waypoints when custom types no longer present
And a custom type was previously selected
This commit is contained in:
@@ -684,8 +684,12 @@ struct BuildRailToolbarWindow : Window {
|
||||
case WID_RAT_BUILD_WAYPOINT:
|
||||
this->last_user_action = widget;
|
||||
_waypoint_count = StationClass::Get(STAT_CLASS_WAYP)->GetSpecCount();
|
||||
if (HandlePlacePushButton(this, WID_RAT_BUILD_WAYPOINT, SPR_CURSOR_WAYPOINT, HT_RECT) && _waypoint_count > 1) {
|
||||
if (HandlePlacePushButton(this, WID_RAT_BUILD_WAYPOINT, SPR_CURSOR_WAYPOINT, HT_RECT)) {
|
||||
if (_waypoint_count > 1) {
|
||||
ShowBuildWaypointPicker(this);
|
||||
} else {
|
||||
_cur_waypoint_type = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -534,7 +534,11 @@ struct BuildRoadToolbarWindow : Window {
|
||||
if (HandlePlacePushButton(this, WID_ROT_BUILD_WAYPOINT, SPR_CURSOR_WAYPOINT, HT_RECT)) {
|
||||
this->last_started_action = widget;
|
||||
_waypoint_count = RoadStopClass::Get(ROADSTOP_CLASS_WAYP)->GetSpecCount();
|
||||
if (_waypoint_count > 1) ShowBuildWaypointPicker(this);
|
||||
if (_waypoint_count > 1) {
|
||||
ShowBuildWaypointPicker(this);
|
||||
} else {
|
||||
_cur_waypoint_type = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user