From 5bfb1cb71ed2982e8a27e1bebe1ee05f715889d3 Mon Sep 17 00:00:00 2001 From: Allanis Date: Mon, 22 Apr 2013 14:46:10 +0100 Subject: [PATCH] [Fix] Some long standing map issues. --- src/map.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/map.c b/src/map.c index 180cb07..18d640a 100644 --- a/src/map.c +++ b/src/map.c @@ -100,9 +100,10 @@ static void map_update(void) { else { f = -1; for(i = 0; i < sys->nplanets; i++) { - if(f == -1) + if((f == -1) && (sys->planets[i].faction != 0)) f = sys->planets[i].faction; - else if(f != sys->planets[i].faction) { + else if(f != sys->planets[i].faction && + (sys->planets[i].faction!=0)) { // TODO: more verbosity. snprintf(buf, 100, "Multiple"); break; @@ -119,9 +120,11 @@ static void map_update(void) { if(sys->nplanets == 0) snprintf(buf, 100, "None"); else { - for(i = 0; i < sys->nplanets; i++) { + if(sys->nplanets > 0) + strcat(buf, sys->planets[0].name); + for(i = 1; i < sys->nplanets; i++) { + strcat(buf, ",\n"); strcat(buf, sys->planets[i].name); - strcat(buf, "\n"); } } window_modifyText(map_wid, "txtPlanets", buf);