(svn r7083) -Fix 6631: Protect out of boundaries widget testing
authorbelugas
Mon, 06 Nov 2006 19:59:19 +0000
changeset 5039 ff17ca5e7c3d
parent 5038 cd0a32afb616
child 5040 2998743e2416
(svn r7083) -Fix 6631: Protect out of boundaries widget testing
misc_gui.c
--- a/misc_gui.c	Mon Nov 06 15:25:02 2006 +0000
+++ b/misc_gui.c	Mon Nov 06 19:59:19 2006 +0000
@@ -1502,6 +1502,10 @@
 		}
 		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);