Fix: crash after heli landing in UB (by Asdow)

Fix: unnecessary town initialization in UB (by Asdow)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8816 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2020-06-01 20:53:22 +00:00
parent f0c8db784a
commit 948ad8caf1
2 changed files with 29 additions and 25 deletions
+1 -1
View File
@@ -463,7 +463,7 @@ void InitStrategicLayer( void )
#ifdef JA2UB #ifdef JA2UB
////if ( gGameUBOptions.InitTownLoyalty_UB == TRUE ) ////if ( gGameUBOptions.InitTownLoyalty_UB == TRUE )
InitTownLoyalty(); //Ja25 no loyalty //InitTownLoyalty(); //Ja25 no loyalty
#else #else
// init town loyalty // init town loyalty
InitTownLoyalty(); //Ja25 no loyalty InitTownLoyalty(); //Ja25 no loyalty
+28 -24
View File
@@ -1396,34 +1396,38 @@ void HandleDialogue( )
// grab soldier ptr from profile ID // grab soldier ptr from profile ID
pSoldier = FindSoldierByProfileID( (UINT8)QItem->uiSpecialEventData, FALSE ); pSoldier = FindSoldierByProfileID( (UINT8)QItem->uiSpecialEventData, FALSE );
// Now, wake these sluts up and have them say quote... // 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.
pSoldier->fIgnoreGetupFromCollapseCheck = FALSE; if (pSoldier != nullptr)
//Get the soldier up
pSoldier->bCollapsed = FALSE;
pSoldier->ChangeSoldierStance( ANIM_STAND );
//if the soldier is Jerry
if( FindSoldierByProfileID( JERRY_MILO_UB, FALSE ) == pSoldier ) //JERRY
{ {
//Play the sound of the Antena breaking // Now, wake these sluts up and have them say quote...
PlayJA2SampleFromFile( "SOUNDS\\Metal Antenna Crunch.wav", RATE_11025, HIGHVOLUME, 1, MIDDLE ); pSoldier->fIgnoreGetupFromCollapseCheck = FALSE;
}
//Turn off the flag saying we are doing the initial heli crash //Get the soldier up
gfFirstTimeInGameHeliCrash = FALSE; pSoldier->bCollapsed = FALSE;
pSoldier->ChangeSoldierStance( ANIM_STAND );
//if all the mercs are done their talk //if the soldier is Jerry
if( AreAllTheMercsFinishedSayingThereInitialHeliCrashQuotes() ) if (FindSoldierByProfileID( JERRY_MILO_UB, FALSE ) == pSoldier) //JERRY
{ {
//Trigger Jerry Milo's script record 10 ( call action 301 ) //Play the sound of the Antena breaking
//AA PlayJA2SampleFromFile( "SOUNDS\\Metal Antenna Crunch.wav", RATE_11025, HIGHVOLUME, 1, MIDDLE );
//if ( gGameUBOptions.InGameHeliCrash == TRUE ) }
if ( gGameUBOptions.JerryQuotes == TRUE )
DelayedMercQuote( JERRY_MILO_UB , 0xffff, 4 ); //JERRY
//End the ui Lock //Turn off the flag saying we are doing the initial heli crash
guiPendingOverrideEvent = LU_ENDUILOCK; gfFirstTimeInGameHeliCrash = FALSE;
//if all the mercs are done their talk
if (AreAllTheMercsFinishedSayingThereInitialHeliCrashQuotes())
{
//Trigger Jerry Milo's script record 10 ( call action 301 )
//AA
//if ( gGameUBOptions.InGameHeliCrash == TRUE )
if (gGameUBOptions.JerryQuotes == TRUE)
DelayedMercQuote( JERRY_MILO_UB, 0xffff, 4 ); //JERRY
//End the ui Lock
guiPendingOverrideEvent = LU_ENDUILOCK;
}
} }
} }
} }