Skip to content

Instantly share code, notes, and snippets.

@nielsmh
Created November 6, 2018 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielsmh/aaac2c206a30df9f5c2acc6867cc663e to your computer and use it in GitHub Desktop.
Save nielsmh/aaac2c206a30df9f5c2acc6867cc663e to your computer and use it in GitHub Desktop.
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1780,6 +1780,7 @@ void CheckOrders(const Vehicle *v)
/* Check the order list */
int n_st = 0;
+ bool has_accessible_depot = v->type != VEH_AIRCRAFT;
FOR_VEHICLE_ORDERS(v, order) {
/* Dummy order? */
@@ -1802,6 +1803,8 @@ void CheckOrders(const Vehicle *v)
message == INVALID_STRING_ID) {
message = STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY;
}
+
+ if (v->type == VEH_AIRCRAFT && st->airport.HasHangar()) has_accessible_depot = true;
}
}
@@ -1817,6 +1820,8 @@ void CheckOrders(const Vehicle *v)
/* Do we only have 1 station in our order list? */
if (n_st < 2 && message == INVALID_STRING_ID) message = STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS;
+ if (!has_accessible_depot && message == INVALID_STRING_ID) message = STR_NEWS_VEHICLE_CAN_NOT_BE_SERVICED_ANYWHERE; /// TODO: add string to english.txt
+
#ifndef NDEBUG
if (v->orders.list != NULL) v->orders.list->DebugCheckSanity();
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment