elrail.c
changeset 5314 fda2b099eec5
parent 5116 3c0c3da214ca
child 5385 3868f2e6db9b
equal deleted inserted replaced
5313:92e5a28568c0 5314:fda2b099eec5
   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 */