summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 6dd38a346..dc21d1000 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -152,7 +152,7 @@ CommandCost CmdMassStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32
if (!vehicle_list_window) {
if (vehicle_type == VEH_TRAIN) {
- if (CheckTrainInDepot(v, false) == -1) continue;
+ if (CheckTrainInDepot((Train *)v, false) == -1) continue;
} else {
if (!(v->vehstatus & VS_HIDDEN)) continue;
}
@@ -381,8 +381,8 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (flags & DC_EXEC) {
w = Vehicle::Get(_new_vehicle_id);
- if (v->type == VEH_TRAIN && HasBit(v->u.rail.flags, VRF_REVERSE_DIRECTION)) {
- SetBit(w->u.rail.flags, VRF_REVERSE_DIRECTION);
+ if (v->type == VEH_TRAIN && HasBit(((Train *)v)->u.rail.flags, VRF_REVERSE_DIRECTION)) {
+ SetBit(((Train *)w)->u.rail.flags, VRF_REVERSE_DIRECTION);
}
if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
@@ -403,7 +403,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
w_rear = w; // trains needs to know the last car in the train, so they can add more in next loop
}
- } while (v->type == VEH_TRAIN && (v = GetNextVehicle(v)) != NULL);
+ } while (v->type == VEH_TRAIN && (v = GetNextVehicle((Train *)v)) != NULL);
if (flags & DC_EXEC && v_front->type == VEH_TRAIN) {
/* for trains this needs to be the front engine due to the callback function */
@@ -437,7 +437,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
if (w->type == VEH_TRAIN && EngineHasArticPart(w)) {
- w = GetNextArticPart(w);
+ w = GetNextArticPart((Train *)w);
} else if (w->type == VEH_ROAD && RoadVehHasArticPart(w)) {
w = w->Next();
} else {
@@ -453,7 +453,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
if (v->type == VEH_TRAIN && EngineHasArticPart(v)) {
- v = GetNextArticPart(v);
+ v = GetNextArticPart((Train *)v);
} else if (v->type == VEH_ROAD && RoadVehHasArticPart(v)) {
v = v->Next();
} else {
@@ -461,8 +461,8 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
}
} while (v != NULL);
- if ((flags & DC_EXEC) && v->type == VEH_TRAIN) w = GetNextVehicle(w);
- } while (v->type == VEH_TRAIN && (v = GetNextVehicle(v)) != NULL);
+ if ((flags & DC_EXEC) && v->type == VEH_TRAIN) w = GetNextVehicle((Train *)w);
+ } while (v->type == VEH_TRAIN && (v = GetNextVehicle((Train *)v)) != NULL);
if (flags & DC_EXEC) {
/*