mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
*** Merged Code from Multiplayer Branch Revision 2960 ***
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+47
-18
@@ -550,23 +550,24 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
gfPendingEnemies = (NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) > mapMaximumNumberOfEnemies );
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
|
||||
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
|
||||
{ //count the number of enemy placements in a map and use those
|
||||
SOLDIERINITNODE *curr = gSoldierInitHead;
|
||||
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
|
||||
while( curr )
|
||||
|
||||
// OJW - 20090403 - override max ai in co-op
|
||||
if (is_networked && is_server && OVERRIDE_MAX_AI == 1)
|
||||
{
|
||||
float totalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites;
|
||||
ubTotalAdmins = ((float)pSector->ubNumAdmins / totalEnemies) * mapMaximumNumberOfEnemies;
|
||||
ubTotalTroops = ((float)pSector->ubNumTroops / totalEnemies) * mapMaximumNumberOfEnemies;
|
||||
ubTotalElites = ((float)pSector->ubNumElites / totalEnemies) * mapMaximumNumberOfEnemies;
|
||||
totalEnemies = ubTotalAdmins + ubTotalTroops + ubTotalElites;
|
||||
|
||||
// take care of any rounding losses
|
||||
while (totalEnemies < mapMaximumNumberOfEnemies)
|
||||
{
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch( curr->pBasicPlacement->ubSoldierClass )
|
||||
{
|
||||
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
|
||||
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
|
||||
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
|
||||
}
|
||||
}
|
||||
curr = curr->next;
|
||||
// just fill out with standard troops
|
||||
ubTotalTroops++;
|
||||
totalEnemies++;
|
||||
}
|
||||
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
@@ -576,9 +577,37 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
}
|
||||
else
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
|
||||
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
|
||||
{ //count the number of enemy placements in a map and use those
|
||||
SOLDIERINITNODE *curr = gSoldierInitHead;
|
||||
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
|
||||
while( curr )
|
||||
{
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch( curr->pBasicPlacement->ubSoldierClass )
|
||||
{
|
||||
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
|
||||
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
|
||||
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
|
||||
}
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
pSector->ubAdminsInBattle = 0;
|
||||
pSector->ubTroopsInBattle = 0;
|
||||
pSector->ubElitesInBattle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
}
|
||||
}
|
||||
|
||||
totalCountOfStationaryEnemies = ubTotalAdmins + ubTotalTroops + ubTotalElites;
|
||||
|
||||
Reference in New Issue
Block a user