src/train_cmd.cpp
changeset 7048 06b931095b26
parent 7046 5f11f759f74d
child 7049 01825af2ce90
equal deleted inserted replaced
7047:578d7e38b601 7048:06b931095b26
   550 		u->cargo_cap = rvi_artic->capacity;
   550 		u->cargo_cap = rvi_artic->capacity;
   551 		u->max_speed = 0;
   551 		u->max_speed = 0;
   552 		u->max_age = 0;
   552 		u->max_age = 0;
   553 		u->engine_type = engine_type;
   553 		u->engine_type = engine_type;
   554 		u->value = 0;
   554 		u->value = 0;
   555 		u->type = VEH_TRAIN;
   555 		u = new (u) Train();
   556 		u->subtype = 0;
   556 		u->subtype = 0;
   557 		SetArticulatedPart(u);
   557 		SetArticulatedPart(u);
   558 		u->cur_image = 0xAC2;
   558 		u->cur_image = 0xAC2;
   559 		u->random_bits = VehicleRandomBits();
   559 		u->random_bits = VehicleRandomBits();
   560 
   560 
   628 //			v->day_counter = 0;
   628 //			v->day_counter = 0;
   629 
   629 
   630 			v->u.rail.railtype = rvi->railtype;
   630 			v->u.rail.railtype = rvi->railtype;
   631 
   631 
   632 			v->build_year = _cur_year;
   632 			v->build_year = _cur_year;
   633 			v->type = VEH_TRAIN;
   633 			v = new (v) Train();
   634 			v->cur_image = 0xAC2;
   634 			v->cur_image = 0xAC2;
   635 			v->random_bits = VehicleRandomBits();
   635 			v->random_bits = VehicleRandomBits();
   636 
   636 
   637 			AddArticulatedParts(vl);
   637 			AddArticulatedParts(vl);
   638 
   638 
   694 	if (building) v->next = u;
   694 	if (building) v->next = u;
   695 	u->engine_type = v->engine_type;
   695 	u->engine_type = v->engine_type;
   696 	u->build_year = v->build_year;
   696 	u->build_year = v->build_year;
   697 	if (building) v->value >>= 1;
   697 	if (building) v->value >>= 1;
   698 	u->value = v->value;
   698 	u->value = v->value;
   699 	u->type = VEH_TRAIN;
   699 	u = new (u) Train();
   700 	u->cur_image = 0xAC2;
   700 	u->cur_image = 0xAC2;
   701 	u->random_bits = VehicleRandomBits();
   701 	u->random_bits = VehicleRandomBits();
   702 	VehiclePositionChanged(u);
   702 	VehiclePositionChanged(u);
   703 }
   703 }
   704 
   704 
   787 			_new_vehicle_id = v->index;
   787 			_new_vehicle_id = v->index;
   788 
   788 
   789 			v->service_interval = _patches.servint_trains;
   789 			v->service_interval = _patches.servint_trains;
   790 			v->date_of_last_service = _date;
   790 			v->date_of_last_service = _date;
   791 			v->build_year = _cur_year;
   791 			v->build_year = _cur_year;
   792 			v->type = VEH_TRAIN;
   792 			v = new (v) Train();
   793 			v->cur_image = 0xAC2;
   793 			v->cur_image = 0xAC2;
   794 			v->random_bits = VehicleRandomBits();
   794 			v->random_bits = VehicleRandomBits();
   795 
   795 
   796 			v->vehicle_flags = 0;
   796 			v->vehicle_flags = 0;
   797 			if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SETBIT(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
   797 			if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SETBIT(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);