Improved code readability by Dennis' advice.

* First reverted changes of r1042, then modified the r1041 version to work according to Watermelon's specifications.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1043 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-01-28 17:26:00 +00:00
parent 05be814426
commit 2ff7b1acd5
1 changed files with 5 additions and 5 deletions

View File

@ -1000,13 +1000,13 @@ void aiUpdateDroid(DROID *psDroid)
if((psDroid->id % TARGET_UPD_SKIP_FRAMES) ==
(frameGetFrameNumber() % TARGET_UPD_SKIP_FRAMES))
{
// updates all targets
i = 0;
(void)updateAttackTarget((BASE_OBJECT*)psDroid, 0); // this function always has to be called on weapon-slot 0 (even if ->numWeaps == 0)
//updates all targets
for (i = 1; i < psDroid->numWeaps; ++i)
{
(void)updateAttackTarget((BASE_OBJECT*)psDroid, i);
++i;
} while (i < psDroid->numWeaps);
// This iteration-style ensures updateAttackTarget is always called on weapon-slot 0
}
}
}
}