mirror of https://github.com/OpenTTD/OpenTTD
(svn r7083) -Fix 6631: Protect out of boundaries widget testing
parent
701c47fb4a
commit
54b0726d58
|
@ -1502,6 +1502,10 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WE_TIMEOUT:
|
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 (IsWindowWidgetLowered(w, 11)) { /* Delete button clicked */
|
||||||
if (!FiosDelete(OTTD2FS(WP(w,querystr_d).text.buf))) {
|
if (!FiosDelete(OTTD2FS(WP(w,querystr_d).text.buf))) {
|
||||||
ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);
|
ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue