[Fix] Problems with system with one unlandable planet.
This commit is contained in:
		
							parent
							
								
									98443fd466
								
							
						
					
					
						commit
						dca1a33c36
					
				
							
								
								
									
										14
									
								
								src/player.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/player.c
									
									
									
									
									
								
							| @ -1294,6 +1294,10 @@ void player_land(void) { | |||||||
|     } |     } | ||||||
|     planet_target = tp; |     planet_target = tp; | ||||||
|     player_rmFlag(PLAYER_LANDACK); |     player_rmFlag(PLAYER_LANDACK); | ||||||
|  | 
 | ||||||
|  |     // No landable planet.
 | ||||||
|  |     if(planet_target < 0) return; | ||||||
|  | 
 | ||||||
|     player_land(); // Re-run land protocol.
 |     player_land(); // Re-run land protocol.
 | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @ -1375,7 +1379,7 @@ double player_faceHyperspace(void) { | |||||||
| // Activate afterburner.
 | // Activate afterburner.
 | ||||||
| void player_afterburn(void) { | void player_afterburn(void) { | ||||||
|   // TODO: Fancy effects.
 |   // TODO: Fancy effects.
 | ||||||
|   if(player->afterburner != NULL) { |   if((player != NULL) && (player->afterburner != NULL)) { | ||||||
|     player_setFlag(PLAYER_AFTERBURNER); |     player_setFlag(PLAYER_AFTERBURNER); | ||||||
|     pilot_setFlag(player, PILOT_AFTERBURNER); |     pilot_setFlag(player, PILOT_AFTERBURNER); | ||||||
|     spfx_shake(player->afterburner->outfit->u.afb.rumble * SHAKE_MAX); |     spfx_shake(player->afterburner->outfit->u.afb.rumble * SHAKE_MAX); | ||||||
| @ -1384,7 +1388,7 @@ void player_afterburn(void) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void player_afterburnOver(void) { | void player_afterburnOver(void) { | ||||||
|   if(player->afterburner != NULL) { |   if((player != NULL) && (player->afterburner != NULL)) { | ||||||
|     player_rmFlag(PLAYER_AFTERBURNER); |     player_rmFlag(PLAYER_AFTERBURNER); | ||||||
|     pilot_rmFlag(player, PILOT_AFTERBURNER); |     pilot_rmFlag(player, PILOT_AFTERBURNER); | ||||||
|     player_stopSound(); |     player_stopSound(); | ||||||
| @ -1393,8 +1397,10 @@ void player_afterburnOver(void) { | |||||||
| 
 | 
 | ||||||
| // Start accelerating.
 | // Start accelerating.
 | ||||||
| void player_accel(double acc) { | void player_accel(double acc) { | ||||||
|   player_acc = acc; |   if(player != NULL) { | ||||||
|   player_playSound(player->ship->sound, 0); |     player_acc = acc; | ||||||
|  |     player_playSound(player->ship->sound, 0); | ||||||
|  |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void player_accelOver(void) { | void player_accelOver(void) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis