Fix #10289: Don't silently fail when setting timetable start dates (#10690)

This commit is contained in:
Tyler Trahan
2023-04-21 18:36:06 -04:00
committed by GitHub
parent 018f0f63a6
commit f45509848a
3 changed files with 3 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ CommandCost CmdSetTimetableStart(DoCommandFlag flags, VehicleID veh_id, bool tim
if (start_date < 0 || start_date > MAX_DAY) return CMD_ERROR;
if (start_date - _date > MAX_TIMETABLE_START_YEARS * DAYS_IN_LEAP_YEAR) return CMD_ERROR;
if (_date - start_date > DAYS_IN_LEAP_YEAR) return CMD_ERROR;
if (timetable_all && !v->orders->IsCompleteTimetable()) return CMD_ERROR;
if (timetable_all && !v->orders->IsCompleteTimetable()) return CommandCost(STR_ERROR_TIMETABLE_INCOMPLETE);
if (timetable_all && start_date + total_duration / DAY_TICKS > MAX_DAY) return CMD_ERROR;
if (flags & DC_EXEC) {