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-861f7616d084master
parent
05be814426
commit
2ff7b1acd5
10
src/ai.c
10
src/ai.c
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue