diff options
author | matthijs <matthijs@openttd.org> | 2005-05-03 20:45:23 +0000 |
---|---|---|
committer | matthijs <matthijs@openttd.org> | 2005-05-03 20:45:23 +0000 |
commit | f04ba0b67992c7aa3c0056675bf7f81a00c6d969 (patch) | |
tree | 7bc7501d9478e3e45c2b4d8d2bea5cbc5d3deb9c /roadveh_cmd.c | |
parent | f7eb57c0fcf60e6992ce38ae61533b6c75f13a24 (diff) | |
download | openttd-f04ba0b67992c7aa3c0056675bf7f81a00c6d969.tar.xz |
(svn r2262) - Fix: Assertion when vehicle in a depot wants to do pathfinding.
GetVehicleTrackdir now tries to get a valid trackdir as much as possibly, by assuming that a vehicle is facing outwards in a depot or road station, for example.
- Codechange: [Multistop] Multistop now also tries to find a slot for road vehicles that are in stations, since the pathfinder now properly handles that.
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index 08507023d..64ba65548 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -311,13 +311,7 @@ static Depot *FindClosestRoadDepot(Vehicle *v) if (_patches.new_pathfinding_all) { NPFFoundTargetData ftd; /* See where we are now */ - byte trackdir; - if (IsRoadStationTile(tile)) - /* if we are in a station, simulate leaving the station (since - * v->direction won't contain anything usefule than */ - trackdir = _dir_to_diag_trackdir[GetRoadStationDir(tile)]; - else - trackdir = GetVehicleTrackdir(v); + byte trackdir = GetVehicleTrackdir(v); ftd = NPFRouteToDepotBreadthFirst(v->tile, trackdir, TRANSPORT_ROAD, v->owner); if (ftd.best_bird_dist == 0) @@ -1665,7 +1659,7 @@ void OnNewDay_RoadVeh(Vehicle *v) } //We do not have a slot, so make one - if (v->u.road.slot == NULL && rs != NULL && IsTileType(v->tile, MP_STREET)) { + if (v->u.road.slot == NULL && rs != NULL) { //first we need to find out how far our stations are away. DEBUG(ms, 2) ("Multistop: Attempting to obtain a slot for vehicle %d at station %d (0x%x)", v->unitnumber, st->index, st->xy); |