From d9391de58a89b9941a8ab19ac660baeb3d898a90 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sun, 22 Jun 2025 12:41:24 +0300 Subject: [PATCH] Fix laptop crush popup text Due to additional dialogue flag having the value 8, and UB not having a specific flag for mercs standing up after heli crash, the FindSoldierByProfileID would always find Steroid if he was on the team, and then display the crunched laptop popup text. Adding a new flag that is checked before we go into that branch in HandleDialogue fixes the issue. --- Tactical/Dialogue Control.cpp | 4 ++-- Tactical/Dialogue Control.h | 1 + Tactical/Overhead.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp index 00b32f72..10fa1d9c 100644 --- a/Tactical/Dialogue Control.cpp +++ b/Tactical/Dialogue Control.cpp @@ -1345,10 +1345,10 @@ void HandleDialogue( ) { HandleEveryoneDoneTheirEndGameQuotes(); } - else + else if ( QItem.uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH ) { // grab soldier ptr from profile ID - pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData, FALSE ); + pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData2, FALSE ); // FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that. if (pSoldier != nullptr) diff --git a/Tactical/Dialogue Control.h b/Tactical/Dialogue Control.h index f2aca38e..5c422c2e 100644 --- a/Tactical/Dialogue Control.h +++ b/Tactical/Dialogue Control.h @@ -262,6 +262,7 @@ enum DialogQuoteIDs #ifdef JA2UB #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000 #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000 +#define MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH 0x08000000 #else #define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001 #define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002 diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index ddc86eaa..14cdf1ac 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -1077,7 +1077,7 @@ BOOLEAN ExecuteOverhead( ) pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 ); } - SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, pSoldier->ubProfile, 0, 0, pSoldier->iFaceIndex, 0 ); + SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH, pSoldier->ubProfile, 0, pSoldier->iFaceIndex, 0 ); } } else