Skip to content

Commit

Permalink
Fixed ship deletion on invalid hyperspace jump
Browse files Browse the repository at this point in the history
  • Loading branch information
LemADEC committed Sep 2, 2015
1 parent e3798ac commit 6ff8c43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/cr0s/warpdrive/EntityJump.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ private void prepareToJump() {
distance = 0; // FIXME: check collision in straight path, starting with getPossibleJumpDistance() ?
} else if (isHyperspaceJump) {
distance = 0;
if (!isInSpace && !isInHyperSpace) {
String msg = "Unable to reach hyperspace from a planet";
killEntity(msg);
messageToAllPlayersOnShip(msg);
LocalProfiler.stop();
return;
}
} else {
if (toSpace) {
// enter space at current altitude
Expand Down

0 comments on commit 6ff8c43

Please sign in to comment.