From 54403a8251f3de21bb92c81d8f02b1c35cd67fa2 Mon Sep 17 00:00:00 2001 From: terkhen Date: Fri, 11 Jun 2010 20:20:45 +0000 Subject: (svn r19961) -Codechange: Unify "vehicle is destroyed" errors. --- src/ai/api/ai_vehicle.hpp | 2 +- src/ai/api/ai_vehicle.hpp.sq | 3 +-- src/aircraft_cmd.cpp | 4 ++-- src/lang/english.txt | 1 + src/roadveh_cmd.cpp | 4 ++-- src/ship_cmd.cpp | 4 ++-- src/train_cmd.cpp | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/ai/api/ai_vehicle.hpp b/src/ai/api/ai_vehicle.hpp index 124f5a738..c7ee91857 100644 --- a/src/ai/api/ai_vehicle.hpp +++ b/src/ai/api/ai_vehicle.hpp @@ -56,7 +56,7 @@ public: ERR_VEHICLE_CANNOT_REFIT, // [STR_ERROR_CAN_T_REFIT_TRAIN, STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE, STR_ERROR_CAN_T_REFIT_SHIP, STR_ERROR_CAN_T_REFIT_AIRCRAFT] /** Vehicle is destroyed */ - ERR_VEHICLE_IS_DESTROYED, // [STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE, STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE] + ERR_VEHICLE_IS_DESTROYED, // [STR_ERROR_VEHICLE_IS_DESTROYED] /** Vehicle is not in a depot */ ERR_VEHICLE_NOT_IN_DEPOT, // [STR_ERROR_AIRCRAFT_MUST_BE_STOPPED, STR_ERROR_ROAD_VEHICLE_MUST_BE_STOPPED_INSIDE_DEPOT, STR_TRAIN_MUST_BE_STOPPED, STR_ERROR_SHIP_MUST_BE_STOPPED_IN_DEPOT] diff --git a/src/ai/api/ai_vehicle.hpp.sq b/src/ai/api/ai_vehicle.hpp.sq index 2e0ae4e8b..bf876dd59 100644 --- a/src/ai/api/ai_vehicle.hpp.sq +++ b/src/ai/api/ai_vehicle.hpp.sq @@ -88,8 +88,7 @@ void SQAIVehicle_Register(Squirrel *engine) AIError::RegisterErrorMap(STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE, AIVehicle::ERR_VEHICLE_CANNOT_REFIT); AIError::RegisterErrorMap(STR_ERROR_CAN_T_REFIT_SHIP, AIVehicle::ERR_VEHICLE_CANNOT_REFIT); AIError::RegisterErrorMap(STR_ERROR_CAN_T_REFIT_AIRCRAFT, AIVehicle::ERR_VEHICLE_CANNOT_REFIT); - AIError::RegisterErrorMap(STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE, AIVehicle::ERR_VEHICLE_IS_DESTROYED); - AIError::RegisterErrorMap(STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE, AIVehicle::ERR_VEHICLE_IS_DESTROYED); + AIError::RegisterErrorMap(STR_ERROR_VEHICLE_IS_DESTROYED, AIVehicle::ERR_VEHICLE_IS_DESTROYED); AIError::RegisterErrorMap(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED, AIVehicle::ERR_VEHICLE_NOT_IN_DEPOT); AIError::RegisterErrorMap(STR_ERROR_ROAD_VEHICLE_MUST_BE_STOPPED_INSIDE_DEPOT, AIVehicle::ERR_VEHICLE_NOT_IN_DEPOT); AIError::RegisterErrorMap(STR_TRAIN_MUST_BE_STOPPED, AIVehicle::ERR_VEHICLE_NOT_IN_DEPOT); diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index c4383b886..d9aef2a12 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -400,7 +400,7 @@ CommandCost CmdSellAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); ret = CommandCost(EXPENSES_NEW_VEHICLES, -v->value); @@ -477,7 +477,7 @@ CommandCost CmdRefitAircraft(TileIndex tile, DoCommandFlag flags, uint32 p1, uin if (ret.Failed()) return ret; if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_AIRCRAFT_MUST_BE_STOPPED); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); /* Check cargo */ CargoID new_cid = GB(p2, 0, 8); diff --git a/src/lang/english.txt b/src/lang/english.txt index e445bc5f8..47293a76b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3642,6 +3642,7 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE :{WHITE}Can't sell destroyed vehicle... STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE :{WHITE}Can't refit destroyed vehicle... +STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed # Specific vehicle errors STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Can't make train pass signal at danger... diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 390ee11f3..4c783519a 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -338,7 +338,7 @@ CommandCost CmdSellRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); if (!v->IsStoppedInDepot()) { return_cmd_error(STR_ERROR_ROAD_VEHICLE_MUST_BE_STOPPED_INSIDE_DEPOT); @@ -1769,7 +1769,7 @@ CommandCost CmdRefitRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint if (ret.Failed()) return ret; if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_ROAD_VEHICLE_MUST_BE_STOPPED_INSIDE_DEPOT); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); if (new_cid >= NUM_CARGO) return CMD_ERROR; diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 8e12a9f6e..625c0cdd4 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -715,7 +715,7 @@ CommandCost CmdSellShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p CommandCost ret = CheckOwnership(v->owner); if (ret.Failed()) return ret; - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); if (!v->IsStoppedInDepot()) { return_cmd_error(STR_ERROR_SHIP_MUST_BE_STOPPED_IN_DEPOT); @@ -790,7 +790,7 @@ CommandCost CmdRefitShip(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (ret.Failed()) return ret; if (!v->IsStoppedInDepot()) return_cmd_error(STR_ERROR_SHIP_MUST_BE_STOPPED_IN_DEPOT); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); /* Check cargo */ if (new_cid >= NUM_CARGO) return CMD_ERROR; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 2dfca725c..74b0b1622 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1358,7 +1358,7 @@ CommandCost CmdSellRailWagon(TileIndex tile, DoCommandFlag flags, uint32 p1, uin /* Sell a chain of vehicles or not? */ bool sell_chain = HasBit(p2, 0); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_SELL_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); v = v->GetFirstEnginePart(); Train *first = v->First(); @@ -1939,7 +1939,7 @@ CommandCost CmdRefitRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, if (ret.Failed()) return ret; if (!v->IsStoppedInDepot()) return_cmd_error(STR_TRAIN_MUST_BE_STOPPED); - if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_CAN_T_REFIT_DESTROYED_VEHICLE); + if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_ERROR_VEHICLE_IS_DESTROYED); /* Check cargo */ if (new_cid >= NUM_CARGO) return CMD_ERROR; -- cgit v1.2.3-70-g09d2