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>2013-11-12 21:09:30 +0000
committerStijn Buys <ingar@osirion.org>2013-11-12 21:09:30 +0000
commitf192b3019662e9ca6805992ba5e879e5b50b0958 (patch)
tree06b67d800eabfeb588c170017e1f6019487cd8de /src/game/base
parentad8f2fe096b2bca7294f07635675f30b94b2977a (diff)
Support for player autopilot terget next to mission target,
bumped network protocol version to 28, disable freeflight button if there is no autopilot target.
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/game.cc18
-rw-r--r--src/game/base/ship.cc3
2 files changed, 17 insertions, 4 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)
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 7c9de1f..e9d9b54 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -496,9 +496,6 @@ void Ship::set_zone(core::Zone *zone)
void Ship::set_autopilot_target(core::Entity *target)
{
if (ship_autopilot_target != target) {
- if (owner()) {
- owner()->set_mission_target(target);
- }
ship_autopilot_target = target;
}
}