diff options
Diffstat (limited to 'src/game/base/game.cc')
-rw-r--r-- | src/game/base/game.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 4a4441d..776f6c1 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -2723,8 +2723,24 @@ bool Game::load_settings() void Game::frame(float seconds) { - if (!running()) + if (!running()) { return; + } + + for (core::GameInterface::Players::iterator it = core::game()->players().begin(); it != core::game()->players().end(); ++it) { + core::Entity *target = 0; + + // set player autopilot target + if ((*it)->control()) { + assert ((*it)->control()->moduletype() == ship_enttype); + + Ship * ship = static_cast<Ship *>((*it)->control()); + if (ship->state() != Ship::Docked) { + target = ship->autopilot_target(); + } + } + (*it)->set_autopilot_target(target); + } } void Game::player_connect(core::Player *player) |