mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Ctrl + D in turnbased - skip player interrupts for that turn (by Sevenfm)
- This only works for singleplayer - This only works for Old interrupt system git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6682 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7202,7 +7202,10 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
{
|
{
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT8), numBytesRead);
|
||||||
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
||||||
|
{
|
||||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
|
||||||
|
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubDisablePlayerInterrupts, sizeof(gTacticalStatus.ubDisablePlayerInterrupts), sizeof(BOOLEAN), numBytesRead);
|
||||||
|
}
|
||||||
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
||||||
numBytesRead = ReadFieldByField(hFile, &filler, sizeof(filler), sizeof(UINT8), numBytesRead);
|
numBytesRead = ReadFieldByField(hFile, &filler, sizeof(filler), sizeof(UINT8), numBytesRead);
|
||||||
}
|
}
|
||||||
@@ -7210,6 +7213,7 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
|||||||
{
|
{
|
||||||
numBytesRead++; //&gTacticalStatus.ubLastRequesterSurgeryTargetID added with BUGFIX_NPC_DATA_FOR_BIG_MAPS
|
numBytesRead++; //&gTacticalStatus.ubLastRequesterSurgeryTargetID added with BUGFIX_NPC_DATA_FOR_BIG_MAPS
|
||||||
numBytesRead++; //&gTacticalStatus.ubInterruptPending added with IMPROVED_INTERRUPT_SYSTEM
|
numBytesRead++; //&gTacticalStatus.ubInterruptPending added with IMPROVED_INTERRUPT_SYSTEM
|
||||||
|
numBytesRead++; //&gTacticalStatus.ubDisablePlayerInterrupts
|
||||||
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
||||||
numBytesRead++;
|
numBytesRead++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5842,6 +5842,8 @@ void CommonEnterCombatModeCode( )
|
|||||||
|
|
||||||
gTacticalStatus.ubInterruptPending = DISABLED_INTERRUPT;
|
gTacticalStatus.ubInterruptPending = DISABLED_INTERRUPT;
|
||||||
|
|
||||||
|
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
|
||||||
|
|
||||||
// ATE: If we have an item pointer end it!
|
// ATE: If we have an item pointer end it!
|
||||||
CancelItemPointer( );
|
CancelItemPointer( );
|
||||||
|
|
||||||
@@ -6037,6 +6039,8 @@ void ExitCombatMode( )
|
|||||||
|
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_FTM_EXIT_COMBAT ] );// ary-05/05/2009 : add forced turn mode
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_FTM_EXIT_COMBAT ] );// ary-05/05/2009 : add forced turn mode
|
||||||
|
|
||||||
|
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
|
||||||
|
|
||||||
// OK, we have exited combat mode.....
|
// OK, we have exited combat mode.....
|
||||||
// Reset some flags for no aps to move, etc
|
// Reset some flags for no aps to move, etc
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -161,7 +161,8 @@ struct TacticalStatusType
|
|||||||
// SANDRO - added these
|
// SANDRO - added these
|
||||||
UINT8 ubLastRequesterSurgeryTargetID;
|
UINT8 ubLastRequesterSurgeryTargetID;
|
||||||
UINT8 ubInterruptPending;
|
UINT8 ubInterruptPending;
|
||||||
|
// sevenfm: Ctrl+D disable interrupts
|
||||||
|
BOOLEAN ubDisablePlayerInterrupts;
|
||||||
// PADDING GONE!!!!!
|
// PADDING GONE!!!!!
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
|
|||||||
|
|
||||||
SetFastForwardMode(FALSE);
|
SetFastForwardMode(FALSE);
|
||||||
|
|
||||||
|
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
|
||||||
|
|
||||||
// Start the turn of player charactors
|
// Start the turn of player charactors
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -2005,6 +2007,10 @@ BOOLEAN InterruptDuel( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent)
|
|||||||
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"InterruptDuel");
|
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"InterruptDuel");
|
||||||
BOOLEAN fResult = FALSE;
|
BOOLEAN fResult = FALSE;
|
||||||
|
|
||||||
|
// sevenfm: if Ctrl+D pressed - skip all player interrupts for this turn
|
||||||
|
if( !is_networked && !gGameOptions.fImprovedInterruptSystem && pSoldier->bTeam == OUR_TEAM && gTacticalStatus.ubDisablePlayerInterrupts )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
// if opponent can't currently see us and we can see them
|
// if opponent can't currently see us and we can see them
|
||||||
if ( pSoldier->aiData.bOppList[ pOpponent->ubID ] == SEEN_CURRENTLY && pOpponent->aiData.bOppList[pSoldier->ubID] != SEEN_CURRENTLY )
|
if ( pSoldier->aiData.bOppList[ pOpponent->ubID ] == SEEN_CURRENTLY && pOpponent->aiData.bOppList[pSoldier->ubID] != SEEN_CURRENTLY )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1669,6 +1669,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
{
|
{
|
||||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||||
{
|
{
|
||||||
|
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
|
||||||
|
|
||||||
gfSaveGame = FALSE;
|
gfSaveGame = FALSE;
|
||||||
gfCameDirectlyFromGame = TRUE;
|
gfCameDirectlyFromGame = TRUE;
|
||||||
|
|
||||||
@@ -3137,12 +3139,16 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else //End turn only if in combat and it is the player's turn
|
{
|
||||||
|
//End turn only if in combat and it is the player's turn
|
||||||
|
if ( fCtrl )
|
||||||
|
gTacticalStatus.ubDisablePlayerInterrupts = TRUE;
|
||||||
*puiNewEvent = I_ENDTURN;
|
*puiNewEvent = I_ENDTURN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#ifdef JA2TESTVERSION
|
#ifdef JA2TESTVERSION
|
||||||
else if( fCtrl )
|
else if( fCtrl )
|
||||||
AdvanceToNextDay();
|
AdvanceToNextDay();
|
||||||
|
|||||||
Reference in New Issue
Block a user