summaryrefslogtreecommitdiff
path: root/unix.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-03-10 21:44:17 +0000
committerDarkvater <Darkvater@openttd.org>2005-03-10 21:44:17 +0000
commitbb7b7c0e149f0651073ef4f2280f351117f5aa6d (patch)
tree6e63b5cea00b6775271b90770a8b1992c42d59a6 /unix.c
parent53f35f4bb416871b2d015a8620216329445e8051 (diff)
downloadopenttd-bb7b7c0e149f0651073ef4f2280f351117f5aa6d.tar.xz
(svn r1986) - Fix: free _config_file when shutting down openttd. Strange that Valgrind didn't catch this, kudos to TrueLight
- Feature (small): new command-line option -c <config_file>. You can have OpenTTD load alternative config files with this setup, handy for servers, or for saves from other players if you don't want to rename your own config. This will have to do until all game-related settings are saved ingame. Couldn't find the SF patch, so credits to the guy that wrote it.
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/unix.c b/unix.c
index 5c5b4db8e..6ff092b64 100644
--- a/unix.c
+++ b/unix.c
@@ -515,7 +515,10 @@ void DeterminePaths(void)
_path.scenario_dir = str_fmt("%sscenario", _path.personal_dir);
_path.gm_dir = str_fmt("%sgm/", _path.game_data_dir);
_path.data_dir = str_fmt("%sdata/", _path.game_data_dir);
- _config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
+
+ if (_config_file == NULL)
+ _config_file = str_fmt("%sopenttd.cfg", _path.personal_dir);
+
_highscore_file = str_fmt("%shs.dat", _path.personal_dir);
_log_file = str_fmt("%sopenttd.log", _path.personal_dir);