Reformat r7155 to follow coding style

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7157 4a71c877-e1ca-e34f-864e-861f7616d084
master
Guangcong Luo 2009-04-24 03:05:39 +00:00 committed by Git SVN Gateway
parent 2a4a462502
commit b17b7823a8
1 changed files with 13 additions and 3 deletions

View File

@ -339,25 +339,35 @@ void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, in
/* Kerrrbaaang !!!!! a hit */
//Watermelon:Target prediction
if(psTarget->type == OBJ_DROID)
if (psTarget->type == OBJ_DROID)
{
double flightTime;
SDWORD empTime = 0;
if (proj_Direct(psStats) || dist <= psStats->minRange)
{
flightTime = dist / psStats->flightSpeed;
}
else
{
flightTime = sqrt(dist) / 30; /* Purely a guess, but surprisingly effective */
}
if (psTarget->lastHitWeapon == WSC_EMP) {
if (psTarget->lastHitWeapon == WSC_EMP)
{
empTime = EMP_DISABLE_TIME - (gameTime - psTarget->timeLastHit);
CLIP(empTime, 0, EMP_DISABLE_TIME);
if (empTime >= EMP_DISABLE_TIME * 0.9)
{
flightTime = 0; /* Just hit. Assume they'll get hit again */
else {
}
else
{
flightTime -= empTime / 1000;
if (flightTime < 0.0)
{
flightTime = 0.0;
}
}
}