summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-13 00:43:48 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-13 00:43:48 +0000
commit34ffd08a19e1156260223256d87a4cdfa7a080e0 (patch)
treeaa2314af8b03b75a242e3f488acf53a9b07d0a47 /src/order_gui.cpp
parentdef8e7215bdabee99ad49adedb8730ae33b6c47f (diff)
downloadopenttd-34ffd08a19e1156260223256d87a4cdfa7a080e0.tar.xz
(svn r23505) -Add: Indication in the order list if the next destination of an order is out of range.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 513e7b0e2..adfc34798 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -29,6 +29,7 @@
#include "waypoint_base.h"
#include "core/geometry_func.hpp"
#include "hotkeys.h"
+#include "aircraft.h"
#include "table/strings.h"
@@ -260,6 +261,13 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
DrawString(left, rtl ? right - 2 * sprite_size.width - 3 : middle, y, STR_ORDER_INDEX, colour, SA_RIGHT | SA_FORCE);
SetDParam(5, STR_EMPTY);
+ SetDParam(8, STR_EMPTY);
+
+ /* Check range for aircraft. */
+ if (v->type == VEH_AIRCRAFT && Aircraft::From(v)->GetRange() > 0 && order->IsGotoOrder()) {
+ const Order *next = order->next != NULL ? order->next : v->GetFirstOrder();
+ if (GetOrderDistance(order, next, v) > Aircraft::From(v)->acache.cached_max_range_sqr) SetDParam(8, STR_ORDER_OUT_OF_RANGE);
+ }
switch (order->GetType()) {
case OT_DUMMY: