diff options
author | frosch <frosch@openttd.org> | 2008-09-27 14:58:46 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-09-27 14:58:46 +0000 |
commit | 67db5087cd472e0cf340c86b85d0c195e7c123cf (patch) | |
tree | 37781d55de944180d09d9cd6425c749c4707c28e /src/vehiclelist.cpp | |
parent | 05d8a0ebad2a4f8dfb7af8e821aca9a78ee76c12 (diff) | |
download | openttd-67db5087cd472e0cf340c86b85d0c195e7c123cf.tar.xz |
(svn r14406) -Fix [FS#Eddi]: Autoreplace did not work for vehicles in free wagon chains.
Diffstat (limited to 'src/vehiclelist.cpp')
-rw-r--r-- | src/vehiclelist.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index 46762b247..62125d0db 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -18,8 +18,9 @@ * @param tile The tile the depot is located on * @param engines Pointer to list to add vehicles to * @param wagons Pointer to list to add wagons to (can be NULL) + * @param individual_wagons If true add every wagon to #wagons which is not attached to an engine. If false only add the first wagon of every row. */ -void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons) +void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons) { engines->Clear(); if (wagons != NULL && wagons != engines) wagons->Clear(); @@ -32,9 +33,10 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine switch (type) { case VEH_TRAIN: + if (IsArticulatedPart(v) || IsRearDualheaded(v)) continue; if (v->u.rail.track != TRACK_BIT_DEPOT) continue; - if (wagons != NULL && IsFreeWagon(v)) { - *wagons->Append() = v; + if (wagons != NULL && IsFreeWagon(v->First())) { + if (individual_wagons || IsFreeWagon(v)) *wagons->Append() = v; continue; } break; |