1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

(svn r21516) -Codechange: Add IsGroundVehicle function to the Vehicle class.

This commit is contained in:
terkhen
2010-12-14 21:26:03 +00:00
parent 96b98b392a
commit 79e2b3153d
9 changed files with 27 additions and 18 deletions

View File

@@ -1101,7 +1101,7 @@ static void NPFFillWithOrderData(NPFFindStationOrTileData *fstd, const Vehicle *
* So only for train orders to stations we fill fstd->station_index, for all
* others only dest_coords */
if (v->type != VEH_SHIP && (v->current_order.IsType(OT_GOTO_STATION) || v->current_order.IsType(OT_GOTO_WAYPOINT))) {
assert(v->type == VEH_TRAIN || v->type == VEH_ROAD);
assert(v->IsGroundVehicle());
fstd->station_index = v->current_order.GetDestination();
fstd->station_type = (v->type == VEH_TRAIN) ? (v->current_order.IsType(OT_GOTO_STATION) ? STATION_RAIL : STATION_WAYPOINT) : (RoadVehicle::From(v)->IsBus() ? STATION_BUS : STATION_TRUCK);
fstd->not_articulated = v->type == VEH_ROAD && !RoadVehicle::From(v)->HasArticulatedPart();