@@ -590,15 +590,15 @@ void DrawRailCatenary(const TileInfo *ti
default: return;
}
DrawRailCatenaryRailway(ti);
bool SettingsDisableElrail(int32 p1)
void SettingsDisableElrail(int32 new_value)
{
bool disable = (p1 != 0);
bool disable = (new_value != 0);
/* we will now walk through all electric train engines and change their railtypes if it is the wrong one*/
const RailType old_railtype = disable ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL;
const RailType new_railtype = disable ? RAILTYPE_RAIL : RAILTYPE_ELECTRIC;
/* walk through all train engines */
@@ -636,8 +636,7 @@ bool SettingsDisableElrail(int32 p1)
for (Company *c : Company::Iterate()) 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;