@@ -1335,7 +1335,12 @@ function CheckFirstSightingOfSpecificEnemyFromViewer( XComGameState_Unit Sighted
13351335 local X2CharacterTemplate CharacterTemplate ;
13361336 local XComGameState_HeadquartersXCom XComHQ ;
13371337 local int i ;
1338- local bool bPlayFirstSighting ;
1338+ local bool bPlayFirstSighting , bNarrativeAlreadyPlayed ;
1339+ // Variables for Issue #1492
1340+ local XComNarrativeMoment SightedNarrative ;
1341+ local XComGameState_LadderProgress LadderData ;
1342+
1343+ LadderData = XComGameState_LadderProgress (`XCOMHISTORY .GetSingleGameStateObjectForClass ( class 'XComGameState_LadderProgress' , true ) );
13391344
13401345 if ( ViewingUnitState != none )
13411346 {
@@ -1353,11 +1358,43 @@ function CheckFirstSightingOfSpecificEnemyFromViewer( XComGameState_Unit Sighted
13531358 if ( `CHEATMGR == none || !`CHEATMGR .DisableFirstEncounterVO )
13541359 {
13551360 bPlayFirstSighting = false ;
1361+ bNarrativeAlreadyPlayed = false ;
13561362
13571363 if ( GroupLeaderUnitState .IsAlive () )
13581364 {
13591365 XComHQ = XComGameState_HeadquartersXCom (History .GetSingleGameStateObjectForClass (class 'XComGameState_HeadquartersXCom' , true ));
1360- bPlayFirstSighting = (XComHQ != None ) && !XComHQ .HasSeenCharacterTemplate (CharacterTemplate ) && !CharacterTemplate .bNeverShowFirstSighted ;
1366+ // Begin Issue #1492
1367+ /// HL-Docs: ref:Bugfixes; issue:1492
1368+ /// First, we get the 'first-sighted' narrative moment from the group leader character template. Then, we adjust bPlayFirstSighting
1369+ /// to only return true when a narrative moment exists and has not been played already. This reduces the downstream visualizer delay
1370+ /// to 1 second when XCom discovers a new type of unit while scouting but there is no narrative moment to play. This allows the
1371+ /// playing of previously disabled narrative moments, whilst preserving the overall visualization outcome.
1372+ if (LadderData != none )
1373+ {
1374+ if (CharacterTemplate .SightedNarrativeMoments .Length > 1 )
1375+ {
1376+ SightedNarrative = CharacterTemplate .SightedNarrativeMoments [1 ];
1377+ if (SightedNarrative .AmbientMaxPlayCount != 0 && `PRESBASE .GetTimesPlayed (SightedNarrative ) >= SightedNarrative .AmbientMaxPlayCount )
1378+ {
1379+ bNarrativeAlreadyPlayed = true ;
1380+ }
1381+ }
1382+ }
1383+ else if (CharacterTemplate .SightedNarrativeMoments .Length > 0 )
1384+ {
1385+ SightedNarrative = CharacterTemplate .SightedNarrativeMoments [0 ];
1386+ if (SightedNarrative .AmbientMaxPlayCount != 0 && `PRESBASE .GetTimesPlayed (SightedNarrative ) >= SightedNarrative .AmbientMaxPlayCount )
1387+ {
1388+ bNarrativeAlreadyPlayed = true ;
1389+ }
1390+ }
1391+ else
1392+ {
1393+ // There are no sighted narrative moments listed on the character template
1394+ bNarrativeAlreadyPlayed = true ;
1395+ }
1396+ bPlayFirstSighting = (XComHQ != None ) && !XComHQ .HasSeenCharacterTemplate (CharacterTemplate ) && !CharacterTemplate .bNeverShowFirstSighted && !bNarrativeAlreadyPlayed ;
1397+ // End Issue #1492
13611398 }
13621399
13631400 // If this group has not scampered OR the character template hasn't been seen before,
0 commit comments