@@ -559,25 +559,25 @@ bool SettingsDisableElrail(int32 p1)
/* this railroad vehicle is now compatible only with elrail,
* so add there also normal rail compatibility */
t->compatible_railtypes |= RAILTYPES_RAIL;
t->railtype = RAILTYPE_RAIL;
SetBit(t->flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
}
/* Fix the total power and acceleration for trains */
FOR_ALL_TRAINS(t) {
/* power and acceleration is cached only for front engines */
if (IsFrontEngine(t)) {
if (t->IsFrontEngine()) {
TrainPowerChanged(t);
UpdateTrainAcceleration(t);
FOR_ALL_COMPANIES(c) c->avail_railtypes = GetCompanyRailtypes(c->index);
/* This resets the _last_built_railtype, which will be invalid for electric
* rails. It may have unintended consequences if that function is ever
* extended, though. */
ReinitGuiAfterToggleElrail(disable);
return true;