1084 |
1084 |
1085 NPFFillWithOrderData(&fstd, v); |
1085 NPFFillWithOrderData(&fstd, v); |
1086 trackdir = DiagdirToDiagTrackdir(enterdir); |
1086 trackdir = DiagdirToDiagTrackdir(enterdir); |
1087 //debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir); |
1087 //debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir); |
1088 |
1088 |
1089 ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); |
1089 ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE, PBS_MODE_NONE); |
1090 if (ftd.best_trackdir == 0xff) { |
1090 if (ftd.best_trackdir == 0xff) { |
1091 /* We are already at our target. Just do something */ |
1091 /* We are already at our target. Just do something */ |
1092 //TODO: maybe display error? |
1092 //TODO: maybe display error? |
1093 //TODO: go straight ahead if possible? |
1093 //TODO: go straight ahead if possible? |
1094 return_track(FindFirstBit2x64(bitmask)); |
1094 return_track(FindFirstBit2x64(bitmask)); |
1161 assert(trackdir != 0xFF); |
1161 assert(trackdir != 0xFF); |
1162 |
1162 |
1163 fstd.dest_coords = tile; |
1163 fstd.dest_coords = tile; |
1164 fstd.station_index = -1; // indicates that the destination is a tile, not a station |
1164 fstd.station_index = -1; // indicates that the destination is a tile, not a station |
1165 |
1165 |
1166 return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE).best_path_dist; |
1166 return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE, PBS_MODE_NONE).best_path_dist; |
1167 } |
1167 } |
1168 |
1168 |
1169 typedef struct RoadDriveEntry { |
1169 typedef struct RoadDriveEntry { |
1170 byte x,y; |
1170 byte x,y; |
1171 } RoadDriveEntry; |
1171 } RoadDriveEntry; |