[Add] Conserve hyperspace path when taking off.

This commit is contained in:
Allanis 2013-06-01 17:39:20 +01:00
parent 6932ea8a8a
commit 39871138e6
2 changed files with 9 additions and 1 deletions

View File

@ -62,6 +62,9 @@ Planet* land_planet = NULL;
static Mission* mission_computer = NULL;
static int mission_ncomputer = 0;
// Player stuff.
extern int hyperspace_target;
// Window stuff.
static int land_wid = 0; // Primary land window.
// For the second opened land window
@ -1024,7 +1027,7 @@ void land(Planet* p) {
// Takeoff from the planet.
void takeoff(void) {
int sw, sh, i;
int sw, sh, i, h;
char* lt;
if(!landed) return;
@ -1055,7 +1058,10 @@ void takeoff(void) {
player_message("taking off from %s on %s", land_planet->name, lt);
free(lt);
// Initialize the new space.
h = hyperspace_target;
space_init(NULL);
hyperspace_target = h;
// Cleanup.
save_all(); // Must be before cleaning up planet. Duh!

View File

@ -335,6 +335,8 @@ void player_swapShip(char* shipname) {
void player_cleanup(void) {
int i;
player_clear();
// Cleanup name.
if(player_name != NULL) free(player_name);