diff --git a/src/player.c b/src/player.c index ef10c74..9be6006 100644 --- a/src/player.c +++ b/src/player.c @@ -2249,17 +2249,17 @@ void player_afterburnOver(void) { * @param acc How much thrust should be applied of maximum (0 - 1). */ void player_accel(double acc) { - if(pilot_isFlag(player, PILOT_HYP_PREP) || pilot_isFlag(player, PILOT_HYPERSPACE)) + if((player == NULL) || pilot_isFlag(player, PILOT_HYP_PREP) || + pilot_isFlag(player, PILOT_HYPERSPACE)) return; - if(player != NULL) { - player_acc = acc; - sound_stopGroup(PLAYER_ENGINE_CHANNEL); - sound_playGroup(PLAYER_ENGINE_CHANNEL, - player->ship->sound, 0); - if(toolkit || paused) - player_soundPause(); - } + player_acc = acc; + sound_stopGroup(PLAYER_ENGINE_CHANNEL); + sound_playGroup(PLAYER_ENGINE_CHANNEL, + player->ship->sound, 0); + + if(toolkit || paused) + player_soundPause(); } /**