Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-12-08 20:41:26 +0000
committerStijn Buys <ingar@osirion.org>2012-12-08 20:41:26 +0000
commitcd4018f65d4933b48688b6fcd11caff75afae263 (patch)
treec02b60eeea38fb91d80a2df0301cf9820cb834db /src/game/base
parentcf7e7dfa5a52c8d1a3e28efcc6e8b9862564fa6c (diff)
Corrected a problem where you end up too close to a planet when using goto.
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/game.cc8
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);
}