- Bugfix: Fixed assertion crash in UC-1.13 cutscene, when Deidranna wants to send troops to the SAM

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4769 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-10-28 09:18:30 +00:00
parent c1fe373866
commit 67812044b8
+16 -12
View File
@@ -4600,19 +4600,23 @@ void ExecuteStrategicAIAction( UINT16 usActionCode, INT16 sSectorX, INT16 sSecto
pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, 0, ubNumSoldiers );
MoveSAIGroupToSector( &pGroup, ubSectorID, STAGE, REINFORCEMENTS );
if( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID )
{ //Clear the pending group's assignment.
pPendingGroup = GetGroup( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID );
Assert( pPendingGroup );
ClearPreviousAIGroupAssignment( pPendingGroup );
}
//Assign the elite squad to attack the SAM site
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
// WANNE: This should fix the assertion in UC in the cutscene!
if (SectorInfo[ ubSectorID ].ubGarrisonID != 255)
{
if( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID )
{ //Clear the pending group's assignment.
pPendingGroup = GetGroup( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID );
Assert( pPendingGroup );
ClearPreviousAIGroupAssignment( pPendingGroup );
}
//Assign the elite squad to attack the SAM site
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
if( pPendingGroup )
{ //Reassign the pending group
ReassignAIGroup( &pPendingGroup );
if( pPendingGroup )
{ //Reassign the pending group
ReassignAIGroup( &pPendingGroup );
}
}
break;