- 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:
Flugente
2012-11-12 20:10:28 +00:00
parent 004728d2e4
commit 1a7e900df5
4 changed files with 79 additions and 22 deletions
+7 -1
View File
@@ -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