12 #include "../stdafx.h"
13 #include "../vehicle_func.h"
15 #include "../roadveh.h"
17 #include "../aircraft.h"
18 #include "../station_base.h"
19 #include "../effectvehicle_base.h"
20 #include "../company_base.h"
21 #include "../company_func.h"
22 #include "../disaster_vehicle.h"
28 #include "../safeguards.h"
39 v->other_multiheaded_part = NULL;
60 if (u->other_multiheaded_part != NULL)
continue;
62 if (u->IsMultiheaded()) {
72 if (sequential_matching) {
91 if (stack_pos == 0)
break;
98 w->other_multiheaded_part = u;
99 u->other_multiheaded_part = w;
121 for (
Train *u = t; u != NULL; u = u->
Next()) {
125 switch (u->subtype) {
134 u->SetArticulatedPart();
144 if (rvi->railveh_type ==
RAILVEH_MULTIHEAD && rvi->image_index == u->spritenum - 1) {
171 FOR_ALL_STATIONS(st) {
272 std::map<Order*, OrderList*> mapping;
328 FOR_ALL_ROADVEHICLES(rv) {
367 v->SetServiceIntervalIsCustom(v->GetServiceInterval() != interval);
376 assert(v->
first != NULL);
492 for (done = 0; done < diff; done++) {
496 if (next != NULL && done < diff && u->IsFrontEngine()) {
506 int r = CountVehiclesInChain(u) - 1;
518 for (moved = 0; moved < diff + 1; moved++) {
523 r = CountVehiclesInChain(u) - 1;
527 u->force_proceed = old_tfp;
531 if (moved < diff + 1)
break;
559 static uint8 _cargo_days;
560 static uint16 _cargo_source;
561 static uint32 _cargo_source_xy;
562 static uint16 _cargo_count;
563 static uint16 _cargo_paid_for;
564 static Money _cargo_feeder_share;
565 static uint32 _cargo_loaded_at_xy;
575 static const SaveLoad _common_veh_desc[] = {
616 SLEG_CONDVAR( _cargo_source, SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
686 SLEG_CONDVAR( _cargo_feeder_share, SLE_FILE_I32 | SLE_VAR_I64, 51, 64),
710 static const SaveLoad _train_desc[] = {
731 static const SaveLoad _roadveh_desc[] = {
751 static const SaveLoad _ship_desc[] = {
761 static const SaveLoad _aircraft_desc[] = {
784 static const SaveLoad _special_desc[] = {
814 static const SaveLoad _disaster_desc[] = {
856 static const SaveLoad *
const _veh_descs[] = {
866 return _veh_descs[vt];
875 SlSetArrayIndex(v->
index);
906 CargoPacket *cp =
new CargoPacket(_cargo_count, _cargo_days, _cargo_source, _cargo_source_xy, _cargo_loaded_at_xy, _cargo_feeder_share);
929 static void Ptrs_VEHS()