[Fix] Fixed possible segfault.
This commit is contained in:
		
							parent
							
								
									34358a6b66
								
							
						
					
					
						commit
						9b4175d5a1
					
				
							
								
								
									
										18
									
								
								src/player.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								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();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user