[Change] Target hostile no longet picks up disabled ships when targetting nearest hostile.

This commit is contained in:
Allanis 2013-02-24 16:09:06 +00:00
parent b55259321e
commit 7d04d86146

View File

@ -83,7 +83,7 @@ unsigned pilot_getHostile(void) {
for(tp = PLAYER_ID, d = 0., i = 0; i < pilots; i++) for(tp = PLAYER_ID, d = 0., i = 0; i < pilots; i++)
if(pilot_isFlag(pilot_stack[i], PILOT_HOSTILE)) { if(pilot_isFlag(pilot_stack[i], PILOT_HOSTILE)) {
td = vect_dist(&pilot_stack[i]->solid->pos, &player->solid->pos); td = vect_dist(&pilot_stack[i]->solid->pos, &player->solid->pos);
if((tp == PLAYER_ID) || (td < d)) { if(!pilot_isDisabled(pilot_stack[i]) && ((tp == PLAYER_ID) || (td < d))) {
d = td; d = td;
tp = pilot_stack[i]->id; tp = pilot_stack[i]->id;
} }