summaryrefslogtreecommitdiff
path: root/order_cmd.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-01-31 11:23:10 +0000
committermatthijs <matthijs@openttd.org>2005-01-31 11:23:10 +0000
commiteb78cdb2d4feacbb5f4f44b958b6a01fe16c56f1 (patch)
treed44a0a41fee496e1abc2bb31d1f29e733309f757 /order_cmd.c
parent0e272f2d1006206baa7820cbbf04e3617feabb9d (diff)
downloadopenttd-eb78cdb2d4feacbb5f4f44b958b6a01fe16c56f1.tar.xz
(svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships. - Uses A* pathfinding (same codebase as the new ai). - Currently unlimited search depth, so might perform badly on large maps/networks (especially ships). - Will always find a route if there is one. - Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values). - With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again. - Feature: Disabling 90 degree turns for trains and ships. - Requires NPF to be enabled. - Ships and trains can no longer make weird 90 degree turns on tile borders. - Codechange: Removed table/directions.h. - table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location? - Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault. - Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64. - Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED. - Codechange: Moved TileAddWrap() to map.[ch] - Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). - Codechange: Moved IsTrainStationTile() to station.h - Add: IsRoadStationTile() and GetRoadStationDir().
Diffstat (limited to 'order_cmd.c')
-rw-r--r--order_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/order_cmd.c b/order_cmd.c
index 809bed18b..fe9f22e23 100644
--- a/order_cmd.c
+++ b/order_cmd.c
@@ -136,9 +136,11 @@ int32 CmdInsertOrder(int x, int y, uint32 flags, uint32 veh_sel, uint32 packed_o
if (v->num_orders >= 40)
return_cmd_error(STR_8832_TOO_MANY_ORDERS);
- /* For ships, make sure that the station is not too far away from the previous destination. */
+ /* For ships, make sure that the station is not too far away from the
+ * previous destination, for human players with new pathfinding disabled */
if (v->type == VEH_Ship && IS_HUMAN_PLAYER(v->owner) &&
- sel != 0 && GetVehicleOrder(v, sel - 1)->type == OT_GOTO_STATION) {
+ sel != 0 && GetVehicleOrder(v, sel - 1)->type == OT_GOTO_STATION
+ && !_patches.new_pathfinding_all) {
int dist = DistanceManhattan(
GetStation(GetVehicleOrder(v, sel - 1)->station)->xy,