diff --git a/src/land.c b/src/land.c index 042106f0e3..08a44cb0f9 100644 --- a/src/land.c +++ b/src/land.c @@ -995,8 +995,9 @@ unsigned int land_getWid( int window ) /** * @brief Opens up all the land dialogue stuff. * @param p Planet to open stuff for. + * @param load Whether or not loading the game. */ -void land( Planet* p ) +void land( Planet* p, int load ) { int i, j; const char *names[LAND_NUMWINDOWS]; @@ -1091,8 +1092,10 @@ void land( Planet* p ) /* 2) Set as landed and run hooks. */ landed = 1; music_choose("land"); /* Must be before hooks in case hooks change music. */ - events_trigger( EVENT_TRIGGER_LAND ); - hooks_run("land"); + if (!load) { + events_trigger( EVENT_TRIGGER_LAND ); + hooks_run("land"); + } /* 3) Generate computer and bar missions. */ if (planet_hasService(land_planet, PLANET_SERVICE_MISSIONS)) diff --git a/src/land.h b/src/land.h index 158ac577a9..9e95d3d8c7 100644 --- a/src/land.h +++ b/src/land.h @@ -41,7 +41,7 @@ extern Planet* land_planet; /* * Main interface. */ -void land ( Planet* p ); +void land( Planet* p, int load ); void takeoff( int delay ); void land_cleanup (void); void land_exit (void); diff --git a/src/pilot.c b/src/pilot.c index 5e4e9509f4..0e9886b46a 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -1691,7 +1691,7 @@ void pilot_update( Pilot* pilot, const double dt ) else if (pilot_isFlag(pilot,PILOT_LANDING)) { if (pilot->ptimer < 0.) { if (pilot_isPlayer(pilot)) { - land( cur_system->planets[ landtarget ] ); + land( cur_system->planets[ landtarget ], 0 ); pilot_rmFlag(pilot,PILOT_LANDING); } else diff --git a/src/save.c b/src/save.c index 8e0ba44ac8..9df91ca508 100644 --- a/src/save.c +++ b/src/save.c @@ -380,7 +380,7 @@ static int load_game( const char* file ) events_trigger( EVENT_TRIGGER_LOAD ); /* Land the player. */ - land( pnt ); + land( pnt, 1 ); /* Sanitize the GUI. */ gui_setCargo();