summaryrefslogtreecommitdiff
path: root/settings.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-11-17 19:43:37 +0000
committerbjarni <bjarni@openttd.org>2005-11-17 19:43:37 +0000
commiteba1f68439364236de7ae3c7792e2a87cfbcf670 (patch)
tree58b3df375737d146806314ed1b4a8e83dffbdac1 /settings.c
parent3e702afc08bd8118f5b01e6493fcdea1aea4c0d4 (diff)
downloadopenttd-eba1f68439364236de7ae3c7792e2a87cfbcf670.tar.xz
(svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
max_autosave_num in the config files sets the number of autosaves to keep (default 16) MAX_NUM_AUTOSAVES in Makefile.config sets the default value. 16 is used if no value is given this behaviour can still be overwritten by keep_all_autosave (openttd.config setting) Note: this is a requested behaviour for PDA ports, since they got limited storage space
Diffstat (limited to 'settings.c')
-rw-r--r--settings.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/settings.c b/settings.c
index 6a92e948a..4456c0988 100644
--- a/settings.c
+++ b/settings.c
@@ -818,6 +818,11 @@ static const SettingDesc gameopt_settings[] = {
{NULL, 0, NULL, NULL, NULL}
};
+#if !defined(MAX_NUM_AUTOSAVES)
+// no custom default max number of autosaves have been set in the makefile, so we will set the default max to 16
+#define MAX_NUM_AUTOSAVES 16
+#endif
+
// The player-based settings (are not send over the network)
// Not everything can just be added to this list. For example, service_interval
// can not be done, because every client assigns the service_interval value to the
@@ -841,6 +846,7 @@ static const SettingDesc patch_player_settings[] = {
{"toolbar_pos", SDT_UINT8, (void*)0, &_patches.toolbar_pos, NULL},
{"keep_all_autosave", SDT_BOOL, (void*)false, &_patches.keep_all_autosave, NULL},
{"autosave_on_exit", SDT_BOOL, (void*)false, &_patches.autosave_on_exit, NULL},
+ {"max_autosave_num", SDT_UINT8, (void*)MAX_NUM_AUTOSAVES, &_patches.max_num_autosaves, NULL},
{"bridge_pillars", SDT_BOOL, (void*)true, &_patches.bridge_pillars, NULL},
{"invisible_trees", SDT_BOOL, (void*)false, &_patches.invisible_trees, NULL},