Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/game.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index f41b9b2..4a4441d 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -1564,16 +1564,17 @@ void Game::func_goto(core::Player *player, const std::string &args)
core::Entity *dock = player->control()->zone()->search_entity(args);
- // if target is docked,goto the dock instead
- if (dock->moduletype() == ship_enttype) {
- Ship *ship = static_cast<Ship *>(dock);
-
- if ((ship->state() == core::Entity::Docked) && (ship->dock())) {
- player->send(ship->name() + " docked at " + ship->dock()->name());
- dock = ship->dock();
+ if (dock) {
+ // if target is docked,goto the dock instead
+ if (dock->moduletype() == ship_enttype) {
+ Ship *othership = static_cast<Ship *>(dock);
+
+ if ((othership->state() == core::Entity::Docked) && (othership->dock())) {
+ player->send(othership->name() + " docked at " + othership->dock()->name());
+ dock = othership->dock();
+ }
}
- }
- if (dock) {
+
Ship *ship = static_cast<Ship *>(player->control());
if (dock->type() == core::Entity::Globe) {