mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix (by navaroe): The game could try to place more soldiers on the map than the map had slots which would cause the game to crash.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7955 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -656,6 +656,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
if (mapMaximumNumberOfEnemies > gGameExternalOptions.ubGameMaximumNumberOfEnemies)
|
||||
mapMaximumNumberOfEnemies = gGameExternalOptions.ubGameMaximumNumberOfEnemies;
|
||||
|
||||
//are there more enemies in the sector then we can actually place on map?
|
||||
gfPendingNonPlayerTeam[ENEMY_TEAM] = (NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM ) > mapMaximumNumberOfEnemies);
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
|
||||
@@ -881,7 +882,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
//sNumSlots = mapMaximumNumberOfEnemies - totalCountOfStationaryEnemies;
|
||||
|
||||
// Flugente: at this point, soldiers have already been placed, thus enough slots for them exist
|
||||
sNumSlots = max( mapMaximumNumberOfEnemies, NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM ) );
|
||||
sNumSlots = min( mapMaximumNumberOfEnemies, NumNonPlayerTeamMembersInSector( gWorldSectorX, gWorldSectorY, ENEMY_TEAM ) );
|
||||
|
||||
pGroup = gpGroupList;
|
||||
while( pGroup && sNumSlots > 0 )
|
||||
|
||||
Reference in New Issue
Block a user