summaryrefslogtreecommitdiff
path: root/src/saveload/saveload.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-02-28 15:41:03 +0100
committerCharles Pigott <charlespigott@googlemail.com>2021-02-28 18:04:51 +0000
commitc3dc27e37e177675c8a54ef507de48b61ed6da2c (patch)
treee42eb666cf8f22c17a0a4042bc62043ecda6c3b8 /src/saveload/saveload.cpp
parent73fd634209a9d54dd167a579e4bb3cced177b896 (diff)
downloadopenttd-c3dc27e37e177675c8a54ef507de48b61ed6da2c.tar.xz
Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
Diffstat (limited to 'src/saveload/saveload.cpp')
-rw-r--r--src/saveload/saveload.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 18f7a17b1..dcfcc9f43 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -208,7 +208,7 @@ struct SaveLoadParams {
StringID error_str; ///< the translatable error message to show
char *extra_msg; ///< the error message
- byte ff_state; ///< The state of fast-forward when saving started.
+ uint16 game_speed; ///< The game speed when saving started.
bool saveinprogress; ///< Whether there is currently a save in progress.
};
@@ -2442,8 +2442,8 @@ static inline void ClearSaveLoadState()
*/
static void SaveFileStart()
{
- _sl.ff_state = _fast_forward;
- _fast_forward = 0;
+ _sl.game_speed = _game_speed;
+ _game_speed = 100;
SetMouseCursorBusy(true);
InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SAVELOAD_START);
@@ -2453,7 +2453,7 @@ static void SaveFileStart()
/** Update the gui accordingly when saving is done and release locks on saveload. */
static void SaveFileDone()
{
- if (_game_mode != GM_MENU) _fast_forward = _sl.ff_state;
+ if (_game_mode != GM_MENU) _game_speed = _sl.game_speed;
SetMouseCursorBusy(false);
InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SAVELOAD_FINISH);