train_cmd.c
changeset 2804 b932fe148d36
parent 2758 9cd8a21e9a7b
child 2805 b6098e7ca457
equal deleted inserted replaced
2803:926cc62f35a7 2804:b932fe148d36
   490 		u->value = 0;
   490 		u->value = 0;
   491 		u->type = VEH_Train;
   491 		u->type = VEH_Train;
   492 		u->subtype = 0;
   492 		u->subtype = 0;
   493 		SetArticulatedPart(u);
   493 		SetArticulatedPart(u);
   494 		u->cur_image = 0xAC2;
   494 		u->cur_image = 0xAC2;
       
   495 		u->random_bits = VehicleRandomBits();
   495 
   496 
   496 		VehiclePositionChanged(u);
   497 		VehiclePositionChanged(u);
   497 	}
   498 	}
   498 }
   499 }
   499 
   500 
   570 			v->u.rail.railtype = GetEngine(engine)->railtype;
   571 			v->u.rail.railtype = GetEngine(engine)->railtype;
   571 
   572 
   572 			v->build_year = _cur_year;
   573 			v->build_year = _cur_year;
   573 			v->type = VEH_Train;
   574 			v->type = VEH_Train;
   574 			v->cur_image = 0xAC2;
   575 			v->cur_image = 0xAC2;
       
   576 			v->random_bits = VehicleRandomBits();
   575 
   577 
   576 			AddArticulatedParts(rvi, vl);
   578 			AddArticulatedParts(rvi, vl);
   577 
   579 
   578 			_new_wagon_id = v->index;
   580 			_new_wagon_id = v->index;
   579 			_new_vehicle_id = v->index;
   581 			_new_vehicle_id = v->index;
   650 	u->build_year = v->build_year;
   652 	u->build_year = v->build_year;
   651 	if (building) v->value >>= 1;
   653 	if (building) v->value >>= 1;
   652 	u->value = v->value;
   654 	u->value = v->value;
   653 	u->type = VEH_Train;
   655 	u->type = VEH_Train;
   654 	u->cur_image = 0xAC2;
   656 	u->cur_image = 0xAC2;
       
   657 	u->random_bits = VehicleRandomBits();
   655 	VehiclePositionChanged(u);
   658 	VehiclePositionChanged(u);
   656 }
   659 }
   657 
   660 
   658 /** Build a railroad vehicle.
   661 /** Build a railroad vehicle.
   659  * @param x,y tile coordinates (depot) where rail-vehicle is built
   662  * @param x,y tile coordinates (depot) where rail-vehicle is built
   744 			v->service_interval = _patches.servint_trains;
   747 			v->service_interval = _patches.servint_trains;
   745 			v->date_of_last_service = _date;
   748 			v->date_of_last_service = _date;
   746 			v->build_year = _cur_year;
   749 			v->build_year = _cur_year;
   747 			v->type = VEH_Train;
   750 			v->type = VEH_Train;
   748 			v->cur_image = 0xAC2;
   751 			v->cur_image = 0xAC2;
       
   752 			v->random_bits = VehicleRandomBits();
   749 
   753 
   750 			v->subtype = 0;
   754 			v->subtype = 0;
   751 			SetFrontEngine(v);
   755 			SetFrontEngine(v);
   752 			SetTrainEngine(v);
   756 			SetTrainEngine(v);
   753 
   757