diff options
author | Stijn Buys <ingar@osirion.org> | 2012-12-08 20:41:26 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-12-08 20:41:26 +0000 |
commit | cd4018f65d4933b48688b6fcd11caff75afae263 (patch) | |
tree | c02b60eeea38fb91d80a2df0301cf9820cb834db /src | |
parent | cf7e7dfa5a52c8d1a3e28efcc6e8b9862564fa6c (diff) |
Corrected a problem where you end up too close to a planet when using goto.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/base/game.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc index db03e4e..1be0b77 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -1468,21 +1468,21 @@ void Game::func_goto(core::Player *player, const std::string &args) if (dock) { if (dock->type() == core::Entity::Globe) { // target is a planet: keep a safe distance - ship->get_location().assign(dock->location() + (dock->axis().forward() *(planet_safe_distance + ship->radius() + dock->radius()))); + ship->get_location().assign(dock->location() + (dock->axis().forward() * (planet_safe_distance + ship->radius() + dock->radius()))); ship->get_axis().assign(dock->axis()); ship->get_axis().change_direction(180.0f); - } if (dock->type() == core::Entity::Controlable) { + } else if (dock->type() == core::Entity::Controlable) { // target is a controlable: appear above it // FIxME target might be docked -> requires ship docked_at awareness // we might want to match the target's state() and speed() - ship->get_location().assign(dock->location() + (dock->axis().up() *(ship->radius() + dock->radius()))); + ship->get_location().assign(dock->location() + (dock->axis().up() * (ship->radius() + dock->radius()))); ship->get_axis().assign(dock->axis()); } else { // targe is something else, appear in front of it - ship->get_location().assign(dock->location() + (dock->axis().forward() *(ship->radius() + dock->radius()))); + ship->get_location().assign(dock->location() + (dock->axis().forward() * (ship->radius() + dock->radius()))); ship->get_axis().assign(dock->axis()); ship->get_axis().change_direction(180.0f); } |