summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-23 23:40:12 +0000
committerrubidium <rubidium@openttd.org>2009-01-23 23:40:12 +0000
commit0909d9f4c4e57af715aa9e150ff328123decb8b9 (patch)
tree13f9f10e802173cf0679d246c9a07634b4c8277f
parentd5465604dc87a2c27d17ff617ae78059a2b4d9c4 (diff)
downloadopenttd-0909d9f4c4e57af715aa9e150ff328123decb8b9.tar.xz
(svn r15246) -Fix [FS#2577]: close all windows *before* starting a new game/loading a game instead of doing that as one of the latest steps of loading the game. This caused, in some cases, the NewGRF settings to be reset when the game was already loaded resulting in instant desyncs when joining a network game
-rw-r--r--src/misc.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index cdd48c293..daa437b6f 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -30,6 +30,7 @@
#include "tilehighlight_func.h"
#include "core/bitmath_func.hpp"
#include "network/network_func.h"
+#include "window_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -60,6 +61,10 @@ void InitializeOldNames();
void InitializeGame(uint size_x, uint size_y, bool reset_date)
{
+ /* Make sure there isn't any window that can influence anything
+ * related to the new game we're about to start/load. */
+ UnInitWindowSystem();
+
AllocateMap(size_x, size_y);
SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);