mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
-fixed percentstatusdrainreduction usage in UseKitPoints
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@489 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+7
-5
@@ -4415,12 +4415,14 @@ UINT16 UseKitPoints( OBJECTTYPE * pObj, UINT16 usPoints, SOLDIERTYPE *pSoldier )
|
||||
|
||||
for (bLoop = pObj->ubNumberOfObjects - 1; bLoop >= 0; bLoop--)
|
||||
{
|
||||
if (usPoints < (UINT16) pObj->bStatus[bLoop])
|
||||
if (Item[pObj->usItem].percentstatusdrainreduction > 0 && ((usPoints * (100 - Item[pObj->usItem].percentstatusdrainreduction))/100) < pObj->bStatus[bLoop] )
|
||||
{
|
||||
if ( Item[pObj->usItem].percentstatusdrainreduction > 0 )
|
||||
pObj->bStatus[bLoop] -= (INT8) ((usPoints * (100 - Item[pObj->usItem].percentstatusdrainreduction ) )/100);
|
||||
else
|
||||
pObj->bStatus[bLoop] -= (INT8) usPoints;
|
||||
pObj->bStatus[bLoop] -= (INT8) ((usPoints * (100 - Item[pObj->usItem].percentstatusdrainreduction ) )/100);
|
||||
return( usOriginalPoints );
|
||||
}
|
||||
else if (usPoints < (UINT16) pObj->bStatus[bLoop])
|
||||
{
|
||||
pObj->bStatus[bLoop] -= (INT8) usPoints;
|
||||
return( usOriginalPoints );
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user