equal
deleted
inserted
replaced
483 return CMD_ERROR; |
483 return CMD_ERROR; |
484 |
484 |
485 /* Trucks can't copy all the orders from busses (and visa versa) */ |
485 /* Trucks can't copy all the orders from busses (and visa versa) */ |
486 if (src->type == VEH_Road) { |
486 if (src->type == VEH_Road) { |
487 const Order *order; |
487 const Order *order; |
488 TileIndex required_dst; |
488 TileIndex required_dst = INVALID_TILE; |
489 |
489 |
490 FOR_VEHICLE_ORDERS(src, order) { |
490 FOR_VEHICLE_ORDERS(src, order) { |
491 if (order->type == OT_GOTO_STATION) { |
491 if (order->type == OT_GOTO_STATION) { |
492 const Station *st = GetStation(order->station); |
492 const Station *st = GetStation(order->station); |
493 required_dst = (dst->cargo_type == CT_PASSENGERS) ? st->bus_stops->xy : st->truck_stops->xy; |
493 if (dst->cargo_type == CT_PASSENGERS) { |
|
494 if (st->bus_stops != NULL) required_dst = st->bus_stops->xy; |
|
495 } else { |
|
496 if (st->truck_stops != NULL) required_dst = st->truck_stops->xy; |
|
497 } |
494 /* This station has not the correct road-bay, so we can't copy! */ |
498 /* This station has not the correct road-bay, so we can't copy! */ |
495 if (!required_dst) |
499 if (required_dst == INVALID_TILE) |
496 return CMD_ERROR; |
500 return CMD_ERROR; |
497 } |
501 } |
498 } |
502 } |
499 } |
503 } |
500 |
504 |