mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Add robots to enemy groups (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8956 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -706,7 +706,7 @@ BOOLEAN AddWaypointStrategicIDToPGroup( GROUP *pGroup, UINT32 uiSectorID )
|
||||
|
||||
//Enemy grouping functions -- private use by the strategic AI.
|
||||
//............................................................
|
||||
GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumTanks, UINT8 ubNumJeeps )
|
||||
GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps )
|
||||
{
|
||||
GROUP *pNew;
|
||||
AssertMsg( uiSector >= 0 && uiSector <= 255, String( "CreateNewEnemyGroup with out of range value of %d", uiSector ) );
|
||||
@@ -717,7 +717,7 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin
|
||||
AssertMsg( pNew->pEnemyGroup, "MemAlloc failure during enemy group creation." );
|
||||
memset( pNew->pEnemyGroup, 0, sizeof( ENEMYGROUP ) );
|
||||
// Make sure group is not bigger than allowed!
|
||||
while ( ubNumAdmins + ubNumTroops + ubNumElites + ubNumTanks + ubNumJeeps > gGameExternalOptions.iMaxEnemyGroupSize )
|
||||
while ( ubNumAdmins + ubNumTroops + ubNumElites + ubNumRobots + ubNumTanks + ubNumJeeps > gGameExternalOptions.iMaxEnemyGroupSize )
|
||||
{
|
||||
if (ubNumTroops)
|
||||
{
|
||||
@@ -731,6 +731,10 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin
|
||||
{
|
||||
ubNumElites--;
|
||||
}
|
||||
else if (ubNumRobots)
|
||||
{
|
||||
ubNumRobots--;
|
||||
}
|
||||
else if (ubNumTanks)
|
||||
{
|
||||
ubNumTanks--;
|
||||
@@ -752,9 +756,10 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin
|
||||
pNew->pEnemyGroup->ubNumAdmins = ubNumAdmins;
|
||||
pNew->pEnemyGroup->ubNumTroops = ubNumTroops;
|
||||
pNew->pEnemyGroup->ubNumElites = ubNumElites;
|
||||
pNew->pEnemyGroup->ubNumRobots = ubNumRobots;
|
||||
pNew->pEnemyGroup->ubNumTanks = ubNumTanks;
|
||||
pNew->pEnemyGroup->ubNumJeeps = ubNumJeeps;
|
||||
pNew->ubGroupSize = (UINT8)(ubNumAdmins + ubNumTroops + ubNumElites + ubNumTanks + ubNumJeeps);
|
||||
pNew->ubGroupSize = (UINT8)(ubNumAdmins + ubNumTroops + ubNumElites + ubNumRobots + ubNumTanks + ubNumJeeps);
|
||||
pNew->ubTransportationMask = FOOT;
|
||||
pNew->fVehicle = FALSE;
|
||||
pNew->ubCreatedSectorID = pNew->ubOriginalSector;
|
||||
|
||||
Reference in New Issue
Block a user