Fix #15318: Nonsensical error message when trying to send aircraft to hangar with no usable airports

This commit is contained in:
Abigail
2026-03-07 14:10:38 +11:00
committed by rubidium42
parent 5f20b45cd8
commit 34f5f1eaea
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -5258,6 +5258,7 @@ STR_ERROR_CAN_T_MOVE_VEHICLE :Can't move vehi
STR_ERROR_REAR_ENGINE_FOLLOW_FRONT :the rear engine will always follow its front counterpart
STR_ERROR_UNABLE_TO_FIND_ROUTE_TO :unable to find route to local depot
STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT :unable to find local depot
STR_ERROR_UNABLE_TO_FIND_LOCAL_HANGAR :unable to find local hangar
STR_ERROR_DEPOT_WRONG_DEPOT_TYPE :wrong depot type
+1 -1
View File
@@ -42,7 +42,7 @@ public:
ERR_VEHICLE_WRONG_DEPOT, // [STR_ERROR_DEPOT_WRONG_DEPOT_TYPE]
/** Vehicle can't return to the depot */
ERR_VEHICLE_CANNOT_SEND_TO_DEPOT, // [STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT, STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT, STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT]
ERR_VEHICLE_CANNOT_SEND_TO_DEPOT, // [STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT, STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT, STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_HANGAR]
/** Vehicle can't start / stop */
ERR_VEHICLE_CANNOT_START_STOP, // [STR_ERROR_CAN_T_STOP_START_TRAIN, STR_ERROR_CAN_T_STOP_START_ROAD_VEHICLE, STR_ERROR_CAN_T_STOP_START_SHIP, STR_ERROR_CAN_T_STOP_START_AIRCRAFT]
+1 -1
View File
@@ -2639,7 +2639,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlags flags, DepotCommandFlags command
}
ClosestDepot closest_depot = this->FindClosestDepot();
static const StringID no_depot[] = {STR_ERROR_UNABLE_TO_FIND_ROUTE_TO, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR};
static const StringID no_depot[] = {STR_ERROR_UNABLE_TO_FIND_ROUTE_TO, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_DEPOT, STR_ERROR_UNABLE_TO_FIND_LOCAL_HANGAR};
if (!closest_depot.found) return CommandCost(no_depot[this->type]);
if (flags.Test(DoCommandFlag::Execute)) {