Bugfix for JaggZilla Bug #623

The crash was caused by Mike or Iggy because they are created from an Elite but don't have ubSoldierClass set to SOLDIER_CLASS_ELITE. Therefore ubNumElites and num remained at 1 when the for loop was done.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6475 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-10-08 17:55:45 +00:00
parent c14e76622a
commit fa56d63ce4
+15
View File
@@ -846,6 +846,21 @@ BOOLEAN PrepareEnemyForSectorBattle()
pSoldier->ubGroupID = pGroup->ubGroupID;
}
break;
// silversurfer: bugfix for Jaggzilla bug #623
// Mike or Iggy can be part of the enemy team and they are created from an Elite but they don't have SOLDIER_CLASS_ELITE.
// Therefore once this for loop was done ubNumElites was still 1 which caused an assertion error.
case SOLDIER_CLASS_NONE:
if( ubNumElites )
{
if ( pSoldier->ubProfile == MIKE || pSoldier->ubProfile == IGGY )
{
num--;
sNumSlots--;
ubNumElites--;
pSoldier->ubGroupID = pGroup->ubGroupID;
}
}
break;
}
}