Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-09 00:29:58 +0000
committerStijn Buys <ingar@osirion.org>2013-11-09 00:29:58 +0000
commit41fcb9f3915db02c9255dc62f03d6b4a55e5b6d3 (patch)
treefd7953b9a59cc3a9c5aa3a70522bf46b787cfb16 /src/game
parentcf4deaa44bebafc829e21704f186e01faa2f940d (diff)
Nudge ships on launch and cargopods on creation to prevent them from spawning inside other objects.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/ship.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 05edf9c..08838ad 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -381,7 +381,9 @@ void Ship::eject(core::Item *item, const long eject_amount, const bool eject_mes
owner()->sound("game/eject");
}
- // reset cargopod physics
+ // reset cargopod physics
+ pod->nudge();
+
pod->reset();
assert(pod->body());
@@ -528,10 +530,13 @@ void Ship::launch()
get_axis().assign(ship_dock->axis());
- if (ship_dock->type() == core::Entity::Globe)
+ if (ship_dock->type() == core::Entity::Globe) {
get_location().assign(ship_dock->location() + (ship_dock->axis().forward() * (PLANET_SAFE_DISTANCE + this->radius() + ship_dock->radius())));
- else
+ } else {
get_location().assign(ship_dock->location() + (ship_dock->axis().forward() * (this->radius() + ship_dock->radius())));
+ }
+
+ nudge();
ship_dock = 0;