From 34f5f1eaeaccfa0ba316d850a49f7e871b2be191 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sat, 7 Mar 2026 14:10:38 +1100 Subject: [PATCH] Fix #15318: Nonsensical error message when trying to send aircraft to hangar with no usable airports --- src/lang/english.txt | 1 + src/script/api/script_vehicle.hpp | 2 +- src/vehicle.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index a907dc59dd..14bf29d512 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -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 diff --git a/src/script/api/script_vehicle.hpp b/src/script/api/script_vehicle.hpp index c6dd530ea4..734e164fff 100644 --- a/src/script/api/script_vehicle.hpp +++ b/src/script/api/script_vehicle.hpp @@ -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] diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b4245f6e62..32a5645c75 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -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)) {