[Add] 'face' will face targetted planet if no pilot target is selected.

This commit is contained in:
Allanis 2013-03-16 23:02:30 +00:00
parent 8b03dfe8f5
commit d9c8dbc449
2 changed files with 12 additions and 5 deletions

View File

@ -91,7 +91,7 @@ static void board_stealCreds(char* str) {
if(p->credits == 0) { if(p->credits == 0) {
// Can't steal from the poor. ;) // Can't steal from the poor. ;)
player_message("The ship has no SCreds left"); player_message("The ship has no SCreds.");
return; return;
} }
@ -104,7 +104,7 @@ static void board_stealCreds(char* str) {
player_credits += p->credits; player_credits += p->credits;
p->credits = 0; p->credits = 0;
board_update(); // Update the lack of credits. board_update(); // Update the lack of credits.
player_message("You manage to steal the ship's Scred"); player_message("You manage to steal the ship's Scred.");
} }
// Failed to board. // Failed to board.

View File

@ -869,9 +869,16 @@ void gui_free(void) {
// Basically uses keyboard input instead of AI input. // Basically uses keyboard input instead of AI input.
void player_think(Pilot* player) { void player_think(Pilot* player) {
// PLAYER_FACE will take over navigation. // PLAYER_FACE will take over navigation.
if(player_isFlag(PLAYER_FACE) && (player_target != PLAYER_ID)) if(player_isFlag(PLAYER_FACE)) {
pilot_face(player, if(player_target != PLAYER_ID)
vect_angle(&player->solid->pos, &pilot_get(player_target)->solid->pos)); pilot_face(player,
vect_angle(&player->solid->pos,
&pilot_get(player_target)->solid->pos));
else if(planet_target != -1)
pilot_face(player,
vect_angle(&player->solid->pos,
&cur_system->planets[planet_target].pos));
}
// PLAYER_REVERSE will take over navigation. // PLAYER_REVERSE will take over navigation.
else if(player_isFlag(PLAYER_REVERSE) && (VMOD(player->solid->vel) > 0.)) else if(player_isFlag(PLAYER_REVERSE) && (VMOD(player->solid->vel) > 0.))