Fixed a 100AP conversion issue for morale and suppression fire.

Fixed a CTD caused by trying to "pickup" an item from sector inventory while simultaneously looking at that items description box.
Upgraded an INT8 to INT16 in training functions to try and catch a problem with INI values being set too high.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2419 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-11-15 00:12:34 +00:00
parent ac6de87d47
commit 944dacd8a4
4 changed files with 14 additions and 7 deletions
+4 -1
View File
@@ -7118,6 +7118,7 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
UINT8 ubPointsLost, ubTotalPointsLost, ubNewStance;
UINT32 uiLoop;
UINT8 ubLoop2;
UINT16 uiLoop3;
SOLDIERTYPE * pSoldier;
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
@@ -7166,7 +7167,9 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
// morale modifier
if (ubTotalPointsLost / 2 > pSoldier->ubAPsLostToSuppression / 2)
{
for ( ubLoop2 = 0; ubLoop2 < (ubTotalPointsLost / 2) - (pSoldier->ubAPsLostToSuppression / 2); ubLoop2++ )
//CHRISL: This should dynamically adjust the number of times we run the morale loop based on AP_MAXIMUM
uiLoop3 = (((ubTotalPointsLost / 2) - (pSoldier->ubAPsLostToSuppression / 2)) * APBPConstants[AP_MAXIMUM]) / 100;
for ( ubLoop2 = 0; ubLoop2 < uiLoop3; ubLoop2++ )
{
HandleMoraleEvent( pSoldier, MORALE_SUPPRESSED, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
}