[Change] Land's auto target only targets landable planets. 'p' still cycles targets.

This commit is contained in:
Allanis 2013-03-20 23:42:46 +00:00
parent bce1019847
commit b286205f56

View File

@ -1065,7 +1065,8 @@ void player_land(void) {
tp = -1; // Temp planet. tp = -1; // Temp planet.
for(i = 0; i < cur_system->nplanets; i++) { for(i = 0; i < cur_system->nplanets; i++) {
d = vect_dist(&player->solid->pos, &cur_system->planets[i].pos); d = vect_dist(&player->solid->pos, &cur_system->planets[i].pos);
if((tp == -1) || ((td == -1) || (td > d))) { if(planet_hasService(&cur_system->planets[i], PLANET_SERVICE_LAND) &&
((tp == -1) || ((td == -1) || (td > d)))) {
tp = i; tp = i;
td = d; td = d;
} }