From 7ce7f691edc2795ae2cefd1e2b7986a9aa1b2275 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 10 Mar 2002 13:35:44 +0000 Subject: [PATCH] * Filtern von duplikaten * Highlighting von newbies --- src/mapper/map_partei.c | 6 +++++- src/mapper/mapper.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mapper/map_partei.c b/src/mapper/map_partei.c index db4af7d9b..b69ac89c7 100644 --- a/src/mapper/map_partei.c +++ b/src/mapper/map_partei.c @@ -270,7 +270,7 @@ read_newfactions(const char * filename) for (;;) { faction * f = factions; char race[20], email[64], lang[8]; - newfaction * nf; + newfaction *nf; int bonus; /* email;race;locale;startbonus */ if (fscanf(F, "%s %s %s %d", email, race, lang, &bonus)<=0) break; @@ -281,6 +281,10 @@ read_newfactions(const char * filename) f = f->next; } if (f) continue; /* skip the ones we've already got */ + for (nf=newfactions;nf;nf=nf->next) { + if (strcmp(nf->email, email)==0) break; + } + if (nf) continue; nf = calloc(sizeof(newfaction), 1); nf->email = strdup(email); nf->race = rc_find(race); diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index be0445335..8316e4a31 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -347,6 +347,18 @@ readfactions(void) modified = 1; } +int +newbie_region(region * r) +{ + unit * u; + if (r==NULL || r->units==NULL) return 0; + for (u=r->units;u;u=u->next) { + if (u->faction->age>10) return 0; + if (u->faction->age==0) return 1; + } + return 0; +} + void drawmap(boolean maponly) { int x, x1, y1, y2, s, q; @@ -439,7 +451,7 @@ drawmap(boolean maponly) { (hl == -6 && fval(r, RF_MALLORN)) || (hl == -7 && fval(r, RF_CHAOTIC)) || (hl == -8 && is_cursed_internal(r->attribs, C_CURSED_BY_THE_GODS, 0)) || - (hl == -9 && r->units && r->units->faction->age==0) || + (hl == -9 && newbie_region(r)) || (hl >= 0 && factionhere(r, hl)) || (x==tx && y1==ty)) addch(rs | A_REVERSE);