elrail.c
changeset 5314 021dbca1d6da
parent 5116 2a33a74925c5
child 5464 d5841259ac07
child 5573 afa6f92a71fd
equal deleted inserted replaced
5313:ea491c0b40f1 5314:021dbca1d6da
   401 	/* we will now walk through all electric train engines and change their railtypes if it is the wrong one*/
   401 	/* we will now walk through all electric train engines and change their railtypes if it is the wrong one*/
   402 	const RailType old_railtype = disable ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL;
   402 	const RailType old_railtype = disable ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL;
   403 	const RailType new_railtype = disable ? RAILTYPE_RAIL : RAILTYPE_ELECTRIC;
   403 	const RailType new_railtype = disable ? RAILTYPE_RAIL : RAILTYPE_ELECTRIC;
   404 
   404 
   405 	/* walk through all train engines */
   405 	/* walk through all train engines */
   406 	for (e_id = 0; e_id < NUM_TRAIN_ENGINES; e_id++)
   406 	for (e_id = 0; e_id < NUM_TRAIN_ENGINES; e_id++) {
   407 	{
       
   408 		const RailVehicleInfo *rv_info = RailVehInfo(e_id);
   407 		const RailVehicleInfo *rv_info = RailVehInfo(e_id);
   409 		Engine *e = GetEngine(e_id);
   408 		Engine *e = GetEngine(e_id);
   410 		/* if it is an electric rail engine and its railtype is the wrong one */
   409 		/* if it is an electric rail engine and its railtype is the wrong one */
   411 		if (rv_info->engclass == 2 && e->railtype == old_railtype) {
   410 		if (rv_info->engclass == 2 && e->railtype == old_railtype) {
   412 			/* change it to the proper one */
   411 			/* change it to the proper one */