[Change] Land's auto target only targets landable planets. 'p' still cycles targets.
This commit is contained in:
parent
bce1019847
commit
b286205f56
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user