src/roadveh_cmd.cpp
changeset 9326 326baf219dda
parent 9323 9bc423363f6a
child 9332 2e120d0bd632
equal deleted inserted replaced
9325:b86050a4912d 9326:326baf219dda
   754 	}
   754 	}
   755 }
   755 }
   756 
   756 
   757 TileIndex RoadVehicle::GetOrderStationLocation(StationID station)
   757 TileIndex RoadVehicle::GetOrderStationLocation(StationID station)
   758 {
   758 {
       
   759 	if (station == this->last_station_visited) this->last_station_visited = INVALID_STATION;
       
   760 
   759 	TileIndex dest = INVALID_TILE;
   761 	TileIndex dest = INVALID_TILE;
   760 
       
   761 	const RoadStop *rs = GetStation(station)->GetPrimaryRoadStop(this);
   762 	const RoadStop *rs = GetStation(station)->GetPrimaryRoadStop(this);
   762 	if (rs != NULL) {
   763 	if (rs != NULL) {
   763 		uint mindist = MAX_UVALUE(uint);
   764 		uint mindist = MAX_UVALUE(uint);
   764 
   765 
   765 		for (; rs != NULL; rs = rs->GetNextRoadStop(this)) {
   766 		for (; rs != NULL; rs = rs->GetNextRoadStop(this)) {