summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-01-21 19:39:26 +0000
committerpeter1138 <peter1138@openttd.org>2006-01-21 19:39:26 +0000
commit935ab76f0f814a1789fb0db5f6a127dd7632f262 (patch)
tree069c7a1056c8b190da68b0e3afff7ff70ab90acf
parent016c49821676c17ceabd4c889942535fa9aa4d62 (diff)
downloadopenttd-935ab76f0f814a1789fb0db5f6a127dd7632f262.tar.xz
(svn r3412) - Fix: When changing game mode, reset the tile highlight data, as it may now be out of bounds. This fixes (at least) an assertion when opening the station builder window.
-rw-r--r--openttd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/openttd.c b/openttd.c
index 28c97c3b5..d30e44bf5 100644
--- a/openttd.c
+++ b/openttd.c
@@ -814,6 +814,10 @@ void SwitchMode(int new_mode)
if (_switch_mode_errorstr != INVALID_STRING_ID)
ShowErrorMessage(INVALID_STRING_ID,_switch_mode_errorstr,0,0);
+
+ // Reset the TileHighlightData as it may be out of bounds if
+ // the new map is smaller than the old map.
+ memset(&_thd, 0, sizeof(_thd));
}