mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user