summaryrefslogtreecommitdiff
path: root/src/console_cmds.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-03 18:06:50 +0000
committerrubidium <rubidium@openttd.org>2007-01-03 18:06:50 +0000
commit2676142ca934b4da52b0ab11191296abcccfcccb (patch)
tree3c678f4533597c150e8401528a07670124846d19 /src/console_cmds.c
parentdd048e8c313a8d6614660cc7072d38cc67ec3cf4 (diff)
downloadopenttd-2676142ca934b4da52b0ab11191296abcccfcccb.tar.xz
(svn r7801) -Feature: add command line option to prevent saving of highscore and configuration on exit and a console command to manually initiate a configuration save (Aloysha).
Diffstat (limited to 'src/console_cmds.c')
-rw-r--r--src/console_cmds.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/console_cmds.c b/src/console_cmds.c
index 7ec55c6b9..46846af7d 100644
--- a/src/console_cmds.c
+++ b/src/console_cmds.c
@@ -201,6 +201,19 @@ DEF_CONSOLE_CMD(ConSave)
return false;
}
+/* Explicitly save the configuration */
+DEF_CONSOLE_CMD(ConSaveConfig)
+{
+ if (argc == 0) {
+ IConsoleHelp("Saves the current config, typically to 'openttd.cfg'.");
+ return true;
+ }
+
+ SaveToConfig();
+ IConsolePrint(_icolour_def, "Saved config.");
+ return true;
+}
+
static const FiosItem* GetFiosItem(const char* file)
{
int i;
@@ -1475,6 +1488,7 @@ void IConsoleStdLibRegister(void)
IConsoleCmdRegister("load", ConLoad);
IConsoleCmdRegister("rm", ConRemove);
IConsoleCmdRegister("save", ConSave);
+ IConsoleCmdRegister("saveconfig", ConSaveConfig);
IConsoleCmdRegister("ls", ConListFiles);
IConsoleCmdRegister("cd", ConChangeDirectory);
IConsoleCmdRegister("pwd", ConPrintWorkingDirectory);