summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-06-27 11:46:41 +0000
committerfrosch <frosch@openttd.org>2015-06-27 11:46:41 +0000
commit613212c486d556ecb776c7d540ebae9c49e3366a (patch)
tree419871c05d76ad107fc80ec069ddf5cf4cff6a01 /src/saveload
parentb35b0a76dbcbdb9aa052f3f814da7bd559e31c29 (diff)
downloadopenttd-613212c486d556ecb776c7d540ebae9c49e3366a.tar.xz
(svn r27320) -Codechange: Do not drop order backups when loading a savegame for replaying.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 2046d004b..969048115 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -16,6 +16,7 @@
#include "../fios.h"
#include "../gamelog_internal.h"
#include "../network/network.h"
+#include "../network/network_func.h"
#include "../gfxinit.h"
#include "../viewport_func.h"
#include "../industry.h"
@@ -2951,18 +2952,20 @@ bool AfterLoadGame()
}
/*
- * Only keep order-backups for network clients.
+ * Only keep order-backups for network clients (and when replaying).
* If we are a network server or not networking, then we just loaded a previously
* saved-by-server savegame. There are no clients with a backup, so clear it.
* Furthermore before savegame version 192 the actual content was always corrupt.
*/
if (!_networking || _network_server || IsSavegameVersionBefore(192)) {
+#ifndef DEBUG_DUMP_COMMANDS
/* Note: We cannot use CleanPool since that skips part of the destructor
* and then leaks un-reachable Orders in the order pool. */
OrderBackup *ob;
FOR_ALL_ORDER_BACKUPS(ob) {
delete ob;
}
+#endif
}