- 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 ); pGroup = CreateNewEnemyGroupDepartingFromSector( SEC_P3, 0, 0, ubNumSoldiers );
MoveSAIGroupToSector( &pGroup, ubSectorID, STAGE, REINFORCEMENTS ); MoveSAIGroupToSector( &pGroup, ubSectorID, STAGE, REINFORCEMENTS );
if( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID ) // WANNE: This should fix the assertion in UC in the cutscene!
{ //Clear the pending group's assignment. if (SectorInfo[ ubSectorID ].ubGarrisonID != 255)
pPendingGroup = GetGroup( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID ); {
Assert( pPendingGroup ); if( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID )
ClearPreviousAIGroupAssignment( pPendingGroup ); { //Clear the pending group's assignment.
} pPendingGroup = GetGroup( gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID );
//Assign the elite squad to attack the SAM site Assert( pPendingGroup );
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS; ClearPreviousAIGroupAssignment( pPendingGroup );
gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID = pGroup->ubGroupID; }
//Assign the elite squad to attack the SAM site
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
gGarrisonGroup[ SectorInfo[ ubSectorID ].ubGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
if( pPendingGroup ) if( pPendingGroup )
{ //Reassign the pending group { //Reassign the pending group
ReassignAIGroup( &pPendingGroup ); ReassignAIGroup( &pPendingGroup );
}
} }
break; break;