mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- Fix: security check for underflows when adding reinforcements
- Fix: added defined heights for kid's heads and torsos to correctly apply headshots - Fix: While filling canteens, poisoned water from sectors is only consumed if no water drum is found git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5684 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1529,7 +1529,13 @@ void AddPossiblePendingEnemiesToBattle()
|
||||
ubGroupIndex = Random( ubNumGroupsInSector);
|
||||
pGroup = pGroupInSectorList[ ubGroupIndex];
|
||||
|
||||
ubNumAvailable = pGroup->ubGroupSize - pGroup->pEnemyGroup->ubElitesInBattle - pGroup->pEnemyGroup->ubTroopsInBattle - pGroup->pEnemyGroup->ubAdminsInBattle;
|
||||
// Flugente fix: check for underflow...
|
||||
UINT8 currentgroupsize = pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle;
|
||||
if ( currentgroupsize > pGroup->ubGroupSize )
|
||||
ubNumAvailable = 0;
|
||||
else
|
||||
ubNumAvailable = pGroup->ubGroupSize - currentgroupsize;
|
||||
|
||||
if (!ubNumAvailable)
|
||||
{
|
||||
// Looks like we picked an empty group. Make a note of it
|
||||
|
||||
Reference in New Issue
Block a user