[Add] Uninhabited planets now show up as so on the radar.

This commit is contained in:
Allanis 2013-08-09 16:14:49 +01:00
parent 06e32a0d4e
commit 4d53076677
2 changed files with 16 additions and 6 deletions

View File

@ -1304,11 +1304,15 @@ void player_land(void) {
}
else if(!player_isFlag(PLAYER_LANDACK)) {
/* No landing authorization. */
if(!areEnemies(player->faction, planet->faction)) {
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 {
} 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);
}
return;
}

View File

@ -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;