Skip to content

Commit

Permalink
* Do not run event/mission hooks when game starts landed.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 12, 2010
1 parent 64c44d0 commit 8e1945d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/land.c
Expand Up @@ -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];
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/land.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/pilot.c
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/save.c
Expand Up @@ -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();
Expand Down

0 comments on commit 8e1945d

Please sign in to comment.