[Fix] Fixed seg fault when trying to land in a system with no planets.
This commit is contained in:
parent
dc3bf1292c
commit
2fc902b90b
@ -4,8 +4,8 @@
|
||||
<player>
|
||||
<ship>TestShip</ship>
|
||||
<credits>
|
||||
<low>10000</low>
|
||||
<high>20000</high>
|
||||
<low>1000000000000</low>
|
||||
<high>9999999999999999</high>
|
||||
</credits>
|
||||
<date>
|
||||
<low>1300</low>
|
||||
|
@ -1689,6 +1689,12 @@ void player_land(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if there are planets to land on. */
|
||||
if(cur_system->nplanets == 0) {
|
||||
player_message("There are no planets to land on.");
|
||||
return;
|
||||
}
|
||||
|
||||
Planet* planet = cur_system->planets[planet_target];
|
||||
if(planet_target >= 0) {
|
||||
if(!planet_hasService(planet, PLANET_SERVICE_LAND)) {
|
||||
|
Loading…
Reference in New Issue
Block a user