[Fix] Some long standing map issues.
This commit is contained in:
parent
35bcabdf16
commit
5bfb1cb71e
11
src/map.c
11
src/map.c
@ -100,9 +100,10 @@ static void map_update(void) {
|
|||||||
else {
|
else {
|
||||||
f = -1;
|
f = -1;
|
||||||
for(i = 0; i < sys->nplanets; i++) {
|
for(i = 0; i < sys->nplanets; i++) {
|
||||||
if(f == -1)
|
if((f == -1) && (sys->planets[i].faction != 0))
|
||||||
f = sys->planets[i].faction;
|
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.
|
// TODO: more verbosity.
|
||||||
snprintf(buf, 100, "Multiple");
|
snprintf(buf, 100, "Multiple");
|
||||||
break;
|
break;
|
||||||
@ -119,9 +120,11 @@ static void map_update(void) {
|
|||||||
if(sys->nplanets == 0)
|
if(sys->nplanets == 0)
|
||||||
snprintf(buf, 100, "None");
|
snprintf(buf, 100, "None");
|
||||||
else {
|
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, sys->planets[i].name);
|
||||||
strcat(buf, "\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window_modifyText(map_wid, "txtPlanets", buf);
|
window_modifyText(map_wid, "txtPlanets", buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user