From 73a10dceaf0092f740a99d8dac09cc9941b1861d Mon Sep 17 00:00:00 2001 From: Wanne Date: Wed, 29 Jun 2011 17:35:42 +0000 Subject: [PATCH] - Singleplayer: Fixed exploit, when it is enemies turn, you can still move when pressing CTRL + L or CTRL + S to open the Save/Load screen and then close the screen without loading/saving o I just disabled loading/saving via the load/save screen when it is the enemies turn o You can still save load via the quicksave slot git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4543 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Turn Based Input.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index e2e30831d..01b06f06a 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -1561,6 +1561,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) gfCameDirectlyFromGame = TRUE; guiPreviousOptionScreen = GAME_SCREEN; + + // cancel, the player can move when it is not its turn! //Heinz: 28.02.09 BUGFIX: player doesn't need to see save/load screen //LeaveTacticalScreen( SAVE_LOAD_SCREEN ); DoQuickLoad(); @@ -1568,6 +1570,14 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) } else if( InputEvent.usKeyState & CTRL_DOWN ) { + // WANNE: Do not allow saving via the save screen when it is not our turn, + // because there is an explit when you close the save window without saving, you can move your merc even it is not your turn + // IF UI HAS LOCKED, ONLY ALLOW EXIT! + if ( gfDisableRegionActive || gfUserTurnRegionActive ) + { + continue; + } + if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) ) { gfSaveGame = FALSE; @@ -3816,6 +3826,14 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) else if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) && !is_networked) { + // WANNE: Do not allow saving via the save screen when it is not our turn, + // because there is an explit when you close the save window without saving, you can move your merc even it is not your turn + // IF UI HAS LOCKED, ONLY ALLOW EXIT! + if ( gfDisableRegionActive || gfUserTurnRegionActive ) + { + continue; + } + //if the game CAN be saved if( CanGameBeSaved() ) {