* 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

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

View File

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