* Filtern von duplikaten

* Highlighting von newbies
This commit is contained in:
Enno Rehling 2002-03-10 13:35:44 +00:00
parent 8bb5509446
commit 7ce7f691ed
2 changed files with 18 additions and 2 deletions

View File

@ -270,7 +270,7 @@ read_newfactions(const char * filename)
for (;;) { for (;;) {
faction * f = factions; faction * f = factions;
char race[20], email[64], lang[8]; char race[20], email[64], lang[8];
newfaction * nf; newfaction *nf;
int bonus; int bonus;
/* email;race;locale;startbonus */ /* email;race;locale;startbonus */
if (fscanf(F, "%s %s %s %d", email, race, lang, &bonus)<=0) break; 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; f = f->next;
} }
if (f) continue; /* skip the ones we've already got */ 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 = calloc(sizeof(newfaction), 1);
nf->email = strdup(email); nf->email = strdup(email);
nf->race = rc_find(race); nf->race = rc_find(race);

View File

@ -347,6 +347,18 @@ readfactions(void)
modified = 1; 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 void
drawmap(boolean maponly) { drawmap(boolean maponly) {
int x, x1, y1, y2, s, q; int x, x1, y1, y2, s, q;
@ -439,7 +451,7 @@ drawmap(boolean maponly) {
(hl == -6 && fval(r, RF_MALLORN)) || (hl == -6 && fval(r, RF_MALLORN)) ||
(hl == -7 && fval(r, RF_CHAOTIC)) || (hl == -7 && fval(r, RF_CHAOTIC)) ||
(hl == -8 && is_cursed_internal(r->attribs, C_CURSED_BY_THE_GODS, 0)) || (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)) || (hl >= 0 && factionhere(r, hl)) ||
(x==tx && y1==ty)) (x==tx && y1==ty))
addch(rs | A_REVERSE); addch(rs | A_REVERSE);