Änderungen an den godcurse funktionen.

This commit is contained in:
Enno Rehling 2002-09-12 19:07:41 +00:00
parent 43024af07d
commit 7aed7ca39c
1 changed files with 24 additions and 8 deletions

View File

@ -112,18 +112,34 @@ static int
curse_emptiness(void) curse_emptiness(void)
{ {
const curse_type * ct = ct_find("godcursezone"); const curse_type * ct = ct_find("godcursezone");
region * r = regions; region * r;
while (r!=NULL) { for (r=regions;r!=NULL;r=r->next) {
if (r->land && r->age>120 && !get_curse(r->attribs, ct)) {
unit * u = r->units; unit * u = r->units;
if (r->land==NULL) continue;
if (fval(r, RF_CHAOTIC)) continue;
if (r->terrain==T_GLACIER) continue;
if (r->age<=120) continue;
if (get_curse(r->attribs, ct)) continue;
while (u && u->faction->no==MONSTER_FACTION) u=u->next; while (u && u->faction->no==MONSTER_FACTION) u=u->next;
if (u==NULL) { if (u==NULL) fset(r, FL_MARK);
}
for (r=regions;r!=NULL;r=r->next) {
if (fval(r, FL_MARK)) {
direction_t d;
for (d=0;d!=MAXDIRECTIONS;++d) {
region * rn = rconnect(r,d);
if (rn==NULL) continue;
if (fval(rn, FL_MARK) || get_curse(rn->attribs, ct)) {
break;
}
}
if (d!=MAXDIRECTIONS) {
curse * c = create_curse(NULL, &r->attribs, ct, curse * c = create_curse(NULL, &r->attribs, ct,
100, 100, 0, 0); 100, 100, 0, 0);
curse_setflag(c, CURSE_ISNEW|CURSE_IMMUNE); curse_setflag(c, CURSE_ISNEW|CURSE_IMMUNE);
} }
freset(r, FL_MARK);
} }
r = r->next;
} }
return 0; return 0;
} }