From cd4018f65d4933b48688b6fcd11caff75afae263 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 8 Dec 2012 20:41:26 +0000 Subject: Corrected a problem where you end up too close to a planet when using goto. --- src/game/base/game.cc | 8 ++++---- 1 file 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); } -- cgit v1.2.3