Auto Resolve code: added type change missing from previous commit, fixed some compiler warnings.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9210 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-11-01 16:19:17 +00:00
parent 01a566494e
commit f9cfb5e831
+6 -6
View File
@@ -4379,7 +4379,7 @@ BOOLEAN TargetHasLoadedGun( SOLDIERTYPE *pSoldier )
void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
{
INT16 sAttack;
UINT16 sDefence;
INT16 sDefence;
UINT8 ubImpact;
UINT8 ubLocation;
INT16 sAccuracy;
@@ -4489,7 +4489,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
fCannon = TRUE;
// cannons have a huge splash zone, so they are much more likely to hit
sAttack *= 1.5;
sAttack = (INT16)(sAttack * 1.5);
}
// if our target is a tank, we use heavy weapons if we have any
else if ( (ARMED_VEHICLE( pTarget->pSoldier ) || ENEMYROBOT( pTarget->pSoldier )) && FireAntiTankWeapon( pAttacker ) )
@@ -4497,7 +4497,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
fAntiTank = TRUE;
// hitting a tank with an rpg isn't easy
sAttack *= 0.8;
sAttack = (INT16)(sAttack * 0.8);
}
else if( !FireAShot( pAttacker ) )
{
@@ -4664,7 +4664,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
UINT8 ubAmmoType = Magazine[Item[(&pAttacker->pSoldier->inv[pAttacker->bWeaponSlot])->usItem].ubClassIndex].ubAmmoType;
ubImpact *= AmmoTypes[ubAmmoType].dDamageModifierTank;
ubImpact = (UINT8)(ubImpact * AmmoTypes[ubAmmoType].dDamageModifierTank);
iRandom = Random( 100 );
if ( iRandom < 15 )
@@ -4715,7 +4715,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
if (sDefence >= pTarget->usDefence)
iRandom = PreRandom(sDefence - pTarget->usDefence);
else
iRandom = -PreRandom(pTarget->usDefence - sDefence);
iRandom = -(INT16)PreRandom(pTarget->usDefence - sDefence);
sAccuracy = (sAttack - sDefence + iRandom) / 10;
@@ -4757,7 +4757,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
if (sDefence >= pTarget->usDefence)
iRandom = PreRandom(sDefence - pTarget->usDefence);
else
iRandom = -PreRandom(pTarget->usDefence - sDefence);
iRandom = -(INT16)PreRandom(pTarget->usDefence - sDefence);
sAccuracy = (sAttack - sDefence + iRandom) / 10;