From 4d530766775e863ebde40dfd4fcfc14bd7b1063c Mon Sep 17 00:00:00 2001 From: Allanis Date: Fri, 9 Aug 2013 16:14:49 +0100 Subject: [PATCH] [Add] Uninhabited planets now show up as so on the radar. --- src/player.c | 12 ++++++++---- src/space.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/player.c b/src/player.c index 7012477..fbbcdcb 100644 --- a/src/player.c +++ b/src/player.c @@ -1304,11 +1304,15 @@ void player_land(void) { } else if(!player_isFlag(PLAYER_LANDACK)) { /* No landing authorization. */ - if(!areEnemies(player->faction, planet->faction)) { - player_message("%s> Permission to land granted.", planet->name); + if(planet_hasService(planet, PLANET_SERVICE_BASIC)) { /* Basic services. */ + if(!areEnemies(player->faction, planet->faction)) { /* Friendly. */ + player_message("%s> Permission to land granted.", planet->name); + player_setFlag(PLAYER_LANDACK); + } else /* Hostile. */ + player_message("%s> Land request denied.", planet->name); + } else { /* No shoes, no shirt, no lifeforms, no services. */ + player_message("Ready to land on %s.", planet->name); player_setFlag(PLAYER_LANDACK); - } else { - player_message("%s> Land request denied.", planet->name); } return; } diff --git a/src/space.c b/src/space.c index cc5064a..f39be09 100644 --- a/src/space.c +++ b/src/space.c @@ -92,14 +92,19 @@ void planets_minimap(const double res, const double w, int i; int cx, cy, x, y, r, rc; double p; + Planet* planet; if(shape == RADAR_CIRCLE) rc = (int)(w*w); glBegin(GL_POINTS); for(i = 0; i < cur_system->nplanets; i++) { - if(areEnemies(player->faction, cur_system->planets[i].faction)) + planet = &cur_system->planets[i]; + + if((planet->faction == -1) && !planet_hasService(planet, PLANET_SERVICE_BASIC)) + COLOUR(cInert); + else if(areEnemies(player->faction, planet->faction)) COLOUR(cHostile); - else if(areAllies(player->faction, cur_system->planets[i].faction)) + else if(areAllies(player->faction, planet->faction)) COLOUR(cFriend); else COLOUR(cNeutral); r = (int)(cur_system->planets[i].gfx_space->sw / res); @@ -470,6 +475,7 @@ static Planet* planet_pull(const char* name) { tstr = xml_nodeProp(node, "name"); if(strcmp(tstr, name)==0) { /* Found. */ tmp = CALLOC_L(Planet); + tmp->faction = -1; /* No faction. */ tmp->name = tstr; node = node->xmlChildrenNode;