diff options
author | Peter Nelson <peter1138@openttd.org> | 2018-05-20 12:01:17 +0100 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2019-01-14 19:57:07 +0000 |
commit | 7af53d7588a97bc4b02dbfa456a0e2a9ab598864 (patch) | |
tree | bd0ee45f0dcdc77ffd2595e70547ea980381447f /src/order_cmd.cpp | |
parent | b98887c4a014d5bc193b0c1089b3ac0334187775 (diff) | |
download | openttd-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.cpp | 3 |
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); } } |