summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-11-06 19:59:19 +0000
committerbelugas <belugas@openttd.org>2006-11-06 19:59:19 +0000
commit8e93b2e729ec68cd092b378a1c0e0adc18ee3849 (patch)
treeb31f3dd357fef59314f38088dde4f0c5a63354df
parentbc92e4ee9b39b4de8fd310893772235639979c04 (diff)
downloadopenttd-8e93b2e729ec68cd092b378a1c0e0adc18ee3849.tar.xz
(svn r7083) -Fix 6631: Protect out of boundaries widget testing
-rw-r--r--misc_gui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc_gui.c b/misc_gui.c
index 4ebe9edd6..1347eede7 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1502,6 +1502,10 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
}
break;
case WE_TIMEOUT:
+ /* This test protects against using widgets 11 and 12 which are only available
+ * in those two saveload mode */
+ if (!(_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO)) break;
+
if (IsWindowWidgetLowered(w, 11)) { /* Delete button clicked */
if (!FiosDelete(OTTD2FS(WP(w,querystr_d).text.buf))) {
ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);