Codechange: use separate pre and post callbacks for int settings

This commit is contained in:
rubidium42
2021-05-24 11:47:37 +02:00
committed by rubidium42
parent e2f5d9e561
commit 08308d808c
16 changed files with 272 additions and 416 deletions

View File

@@ -593,9 +593,9 @@ void DrawRailCatenary(const TileInfo *ti)
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;
@@ -639,5 +639,4 @@ bool SettingsDisableElrail(int32 p1)
* rails. It may have unintended consequences if that function is ever
* extended, though. */
ReinitGuiAfterToggleElrail(disable);
return true;
}