Fix not being able to build waypoints when custom types no longer present

And a custom type was previously selected
pull/407/head
Jonathan G Rennison 2 years ago
parent c19bd4473f
commit f98f5fd291

@ -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) {
ShowBuildWaypointPicker(this);
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;

Loading…
Cancel
Save