summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2018-05-20 12:01:17 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-01-14 19:57:07 +0000
commit7af53d7588a97bc4b02dbfa456a0e2a9ab598864 (patch)
treebd0ee45f0dcdc77ffd2595e70547ea980381447f /src/order_cmd.cpp
parentb98887c4a014d5bc193b0c1089b3ac0334187775 (diff)
downloadopenttd-7af53d7588a97bc4b02dbfa456a0e2a9ab598864.tar.xz
Codechange: Use const instead of magic number for ship order distance. Allow slightly further distance when following orders.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index ba8a1a060..093e4b9b5 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -23,6 +23,7 @@
#include "core/random_func.hpp"
#include "aircraft.h"
#include "roadveh.h"
+#include "ship.h"
#include "station_base.h"
#include "waypoint_base.h"
#include "company_base.h"
@@ -929,7 +930,7 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
dist = GetOrderDistance(prev, &new_order, v);
}
- if (dist >= 130) {
+ if (dist >= SHIP_MAX_ORDER_DISTANCE) {
return_cmd_error(STR_ERROR_TOO_FAR_FROM_PREVIOUS_DESTINATION);
}
}