[Add] Conserve hyperspace path when taking off.
This commit is contained in:
parent
6932ea8a8a
commit
39871138e6
@ -62,6 +62,9 @@ Planet* land_planet = NULL;
|
|||||||
static Mission* mission_computer = NULL;
|
static Mission* mission_computer = NULL;
|
||||||
static int mission_ncomputer = 0;
|
static int mission_ncomputer = 0;
|
||||||
|
|
||||||
|
// Player stuff.
|
||||||
|
extern int hyperspace_target;
|
||||||
|
|
||||||
// Window stuff.
|
// Window stuff.
|
||||||
static int land_wid = 0; // Primary land window.
|
static int land_wid = 0; // Primary land window.
|
||||||
// For the second opened land window
|
// For the second opened land window
|
||||||
@ -1024,7 +1027,7 @@ void land(Planet* p) {
|
|||||||
|
|
||||||
// Takeoff from the planet.
|
// Takeoff from the planet.
|
||||||
void takeoff(void) {
|
void takeoff(void) {
|
||||||
int sw, sh, i;
|
int sw, sh, i, h;
|
||||||
char* lt;
|
char* lt;
|
||||||
|
|
||||||
if(!landed) return;
|
if(!landed) return;
|
||||||
@ -1055,7 +1058,10 @@ void takeoff(void) {
|
|||||||
player_message("taking off from %s on %s", land_planet->name, lt);
|
player_message("taking off from %s on %s", land_planet->name, lt);
|
||||||
free(lt);
|
free(lt);
|
||||||
|
|
||||||
|
// Initialize the new space.
|
||||||
|
h = hyperspace_target;
|
||||||
space_init(NULL);
|
space_init(NULL);
|
||||||
|
hyperspace_target = h;
|
||||||
|
|
||||||
// Cleanup.
|
// Cleanup.
|
||||||
save_all(); // Must be before cleaning up planet. Duh!
|
save_all(); // Must be before cleaning up planet. Duh!
|
||||||
|
@ -335,6 +335,8 @@ void player_swapShip(char* shipname) {
|
|||||||
void player_cleanup(void) {
|
void player_cleanup(void) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
player_clear();
|
||||||
|
|
||||||
// Cleanup name.
|
// Cleanup name.
|
||||||
if(player_name != NULL) free(player_name);
|
if(player_name != NULL) free(player_name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user