From 76429a09b636e5bdfe56a20457ff0fec9fd005ff Mon Sep 17 00:00:00 2001 From: Shadooow Date: Sun, 20 Jun 2021 14:24:15 +0000 Subject: [PATCH] interrogation cutscene will no longer be started if player fired all POW soldiers that were scheduled to appear there git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9089 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Meanwhile.cpp | 48 ++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/Strategic/Meanwhile.cpp b/Strategic/Meanwhile.cpp index 68621df2..682cae21 100644 --- a/Strategic/Meanwhile.cpp +++ b/Strategic/Meanwhile.cpp @@ -411,25 +411,49 @@ void CheckForMeanwhileOKStart( ) return; } - if ( !DialogueQueueIsEmptyOrSomebodyTalkingNow( ) ) - { - return; - } + if ( !DialogueQueueIsEmptyOrSomebodyTalkingNow( ) ) + { + return; + } + + //shadooow: prevent the interrogation meanwhile to start if the mercs were fired from team + if (gCurrentMeanwhileDef.ubMeanwhileID == INTERROGATION) + { + SOLDIERTYPE *pSoldier; + BOOLEAN fFoundSoldierToInterrogate = FALSE; + UINT32 uiCount = 0; + for (pSoldier = MercPtrs[gCharactersList[uiCount].usSolID]; gCharactersList[uiCount].fValid; uiCount++, pSoldier++) + { + if (pSoldier->sSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && pSoldier->sSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY && + pSoldier->bSectorZ == 0 && pSoldier->bAssignment == ASSIGNMENT_POW && pSoldier->stats.bLife > 0 && gMercProfiles[pSoldier->ubProfile].bMercStatus != MERC_FIRED_AS_A_POW) + { + fFoundSoldierToInterrogate = TRUE; + break; + } + } + + if (!fFoundSoldierToInterrogate) + { + gfMeanwhileTryingToStart = FALSE; + ProcessImplicationsOfMeanwhile(); + UnLockPauseState(); + UnPauseGame(); + return; + } + } gfMeanwhileTryingToStart = FALSE; guiOldScreen = guiCurrentScreen; - if ( guiCurrentScreen == GAME_SCREEN ) - { + if ( guiCurrentScreen == GAME_SCREEN ) + { LeaveTacticalScreen( GAME_SCREEN ); - } + } - - - // We need to make sure we have no item - at least in tactical - // In mapscreen, time is paused when manipulating items... - CancelItemPointer( ); + // We need to make sure we have no item - at least in tactical + // In mapscreen, time is paused when manipulating items... + CancelItemPointer( ); BringupMeanwhileBox( ); }