From 0699c54c455970a228d6ba2a93b8ea7eaf941c2b Mon Sep 17 00:00:00 2001 From: matthijs Date: Tue, 3 May 2005 20:45:23 +0000 Subject: (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. --- roadveh_cmd.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'roadveh_cmd.c') 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); -- cgit v1.2.3-54-g00ecf