mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user