mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Multiplayer: Fixed exploit, where a client (which does not currently have the turn) 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 while in turn based mode in a multiplayer game git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4542 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1546,60 +1546,67 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ROMAN.MP
|
||||||
/// Allow to load everywhere
|
// It is not allowed in a network game to go to the load screen, because if you cancel the load screen it is always your turn!
|
||||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
|
if (!is_networked)
|
||||||
{
|
{
|
||||||
if( InputEvent.usKeyState & ALT_DOWN )
|
/// Allow to load everywhere
|
||||||
|
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
|
||||||
{
|
{
|
||||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
if( InputEvent.usKeyState & ALT_DOWN )
|
||||||
{
|
{
|
||||||
gfSaveGame = FALSE;
|
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||||
gfCameDirectlyFromGame = TRUE;
|
{
|
||||||
|
gfSaveGame = FALSE;
|
||||||
|
gfCameDirectlyFromGame = TRUE;
|
||||||
|
|
||||||
guiPreviousOptionScreen = GAME_SCREEN;
|
guiPreviousOptionScreen = GAME_SCREEN;
|
||||||
//Heinz: 28.02.09 BUGFIX: player doesn't need to see save/load screen
|
//Heinz: 28.02.09 BUGFIX: player doesn't need to see save/load screen
|
||||||
//LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
//LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||||
DoQuickLoad();
|
DoQuickLoad();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if( InputEvent.usKeyState & CTRL_DOWN )
|
||||||
else if( InputEvent.usKeyState & CTRL_DOWN )
|
|
||||||
{
|
|
||||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
|
||||||
{
|
{
|
||||||
gfSaveGame = FALSE;
|
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||||
gfCameDirectlyFromGame = TRUE;
|
{
|
||||||
|
gfSaveGame = FALSE;
|
||||||
|
gfCameDirectlyFromGame = TRUE;
|
||||||
|
|
||||||
guiPreviousOptionScreen = GAME_SCREEN;
|
guiPreviousOptionScreen = GAME_SCREEN;
|
||||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_networked)
|
if (is_networked)
|
||||||
{
|
{
|
||||||
|
// WANNE: Disabled the quick saving in a multiplayer game, because if you quit out of the save dialog,
|
||||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 's') )//allow saving 'always'//hayden
|
// you can move your merc even if it is not your turn.
|
||||||
{
|
/*
|
||||||
if( InputEvent.usKeyState & ALT_DOWN )
|
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 's') )//allow saving 'always'//hayden
|
||||||
{
|
{
|
||||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
if( InputEvent.usKeyState & ALT_DOWN )
|
||||||
|
{
|
||||||
|
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||||
|
{
|
||||||
|
//if the game CAN be saved
|
||||||
|
if( CanGameBeSaved() )
|
||||||
{
|
{
|
||||||
//if the game CAN be saved
|
guiPreviousOptionScreen = GAME_SCREEN;
|
||||||
if( CanGameBeSaved() )
|
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||||
{
|
DoQuickSave();
|
||||||
guiPreviousOptionScreen = GAME_SCREEN;
|
|
||||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
|
||||||
DoQuickSave();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Display a message saying the player cant save now
|
|
||||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else if( InputEvent.usKeyState & CTRL_DOWN )
|
{
|
||||||
{
|
//Display a message saying the player cant save now
|
||||||
|
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( InputEvent.usKeyState & CTRL_DOWN )
|
||||||
|
{
|
||||||
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
if( !fDisableMapInterfaceDueToBattle && !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||||
{
|
{
|
||||||
//if the game CAN be saved
|
//if the game CAN be saved
|
||||||
@@ -1616,10 +1623,10 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
//Display a message saying the player cant save now
|
//Display a message saying the player cant save now
|
||||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL);
|
DoMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_OK, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'e') )
|
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'e') )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user