Fix: Errors in UB code

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8647 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2019-01-02 13:22:24 +00:00
parent d65368b6ff
commit 98cab67624
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -488,14 +488,14 @@ UINT8 GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( UINT8 *pSoldierIdArr
if( pProfileIdArray != NULL )
{
//record the profile num of the merc
pProfileIdArray[ bNumMercsPresent ] = pSoldier->ubProfile;
pProfileIdArray[ usNumMercsPresent ] = pSoldier->ubProfile;
}
//if we are to return an array of the mercs
if( pSoldierIdArray != NULL )
{
//record the soldier num of the merc
pSoldierIdArray[ bNumMercsPresent ] = pSoldier->ubID;
pSoldierIdArray[ usNumMercsPresent ] = pSoldier->ubID;
}
++usNumMercsPresent;
@@ -562,7 +562,7 @@ UINT8 RandomArrayOfQualifiedMercs( UINT8 *pRandomSoldierIdArray )
//Get the number and array of the new soldiers
usNumMercsPresent = GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( SoldierIdArray, NULL );
Assert( bNumMercsPresent < NUM_MERCS_WITH_NEW_QUOTES );
Assert( usNumMercsPresent < NUM_MERCS_WITH_NEW_QUOTES );
if( usNumMercsPresent > 0 )
{