File diff r9624:3d09a2b617a4 → r9625:1ffdaa4810d3
src/elrail.cpp
Show inline comments
 
@@ -492,16 +492,19 @@ int32 SettingsDisableElrail(int32 p1)
 
				v->u.rail.railtype = RAILTYPE_RAIL;
 
				SetBit(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
 
			}
 
		}
 
	}
 

	
 
	/* setup total power for trains */
 
	/* Fix the total power and acceleration for trains */
 
	FOR_ALL_VEHICLES(v) {
 
		/* power is cached only for front engines */
 
		if (v->type == VEH_TRAIN && IsFrontEngine(v)) TrainPowerChanged(v);
 
		/* power and acceleration is cached only for front engines */
 
		if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
 
			TrainPowerChanged(v);
 
			UpdateTrainAcceleration(v);
 
		}
 
	}
 

	
 
	FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index);
 

	
 
	/* This resets the _last_built_railtype, which will be invalid for electric
 
	* rails. It may have unintended consequences if that function is ever