-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:
MaddMugsy
2006-08-29 07:03:26 +00:00
parent 891f687107
commit c8a395fa21
2 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
INT16 zVersionLabel[256] = { L"Release v1.13.480" };
INT16 zVersionLabel[256] = { L"Release v1.13.489" };
#endif
+7 -5
View File
@@ -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