summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-11-17 19:31:44 +0000
committerKUDr <kudr@openttd.org>2006-11-17 19:31:44 +0000
commitf2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c (patch)
tree9c7682092cc873482f869cd11ccca7d20fe73bc2 /openttd.c
parent532271ba65c994ee8bc93752b515b8fc918b6ab5 (diff)
downloadopenttd-f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c.tar.xz
(svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openttd.c b/openttd.c
index 0103c279d..43fb5bc4f 100644
--- a/openttd.c
+++ b/openttd.c
@@ -606,6 +606,8 @@ static void MakeNewGameDone(void)
_current_player = _local_player;
DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
+ SettingsDisableElrail(_patches.disable_elrails);
+
MarkWholeScreenDirty();
}
@@ -1536,5 +1538,19 @@ bool AfterLoadGame(void)
ConvertNameArray();
}
+ /* from version 38 we have optional elrails */
+ if (CheckSavegameVersion(38)) {
+ /* old game - before elrails made optional */
+ if (CheckSavegameVersion(24)) {
+ /* very old game - before elrail was introduced */
+ _patches.disable_elrails = true; // disable elrails
+ } else {
+ /* game with mandatory elrails (r4150+) */
+ _patches.disable_elrails = false; // enable elrails
+ }
+ }
+ /* do the same as when elrails were enabled/disabled manually just now */
+ SettingsDisableElrail(_patches.disable_elrails);
+
return true;
}