diff options
author | frosch <frosch@openttd.org> | 2020-01-12 17:23:04 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2020-01-12 19:08:38 +0100 |
commit | a4be4514c9206355af120106e00c18eca8b5d75a (patch) | |
tree | 09b828bdb5e1164a2a797fe394e685b0aeba0d6e /src/saveload/engine_sl.cpp | |
parent | 41163331aa882765e528c0e716f6e49cee2411cb (diff) | |
download | openttd-a4be4514c9206355af120106e00c18eca8b5d75a.tar.xz |
Fix #7925: Reset temporary saveload data at the start of loading a savegame instead of at the end.
Otherwise temporary data may be passed from an aborted load action to the next load action.
Diffstat (limited to 'src/saveload/engine_sl.cpp')
-rw-r--r-- | src/saveload/engine_sl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 4ba38d04b..44ba6498e 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -140,6 +140,11 @@ void CopyTempEngineData() if (se->name != nullptr) e->name = stredup(se->name); } + ResetTempEngineData(); +} + +void ResetTempEngineData() +{ /* Get rid of temporary data */ for (std::vector<Engine*>::iterator it = _temp_engine.begin(); it != _temp_engine.end(); ++it) { FreeEngine(*it); |