Testen, das Einheiten noch am Leben sind, die eigentlich geloescht gehoeren.

This commit is contained in:
Enno Rehling 2006-10-08 22:15:49 +00:00
parent 8f78b586f7
commit cd35467899
1 changed files with 60 additions and 58 deletions

View File

@ -1263,7 +1263,7 @@ randomevents(void)
/* monster-einheiten desertieren */
for (r = regions; r; r=r->next) {
for (u=r->units; u; u=u->next) {
if (u->faction->no != MONSTER_FACTION
if (u->faction && u->faction->no != MONSTER_FACTION
&& (u->race->flags & RCF_DESERT)) {
if (fval(u, UFL_ISNEW)) continue;
if (rng_int()%100 < 5) {
@ -1278,17 +1278,19 @@ randomevents(void)
#ifdef KARMA_MODULE
/* lycanthropen werden werwölfe */
for (f = factions; f; f=f->next) {
if (f->alive) {
int level = fspecial(f, FS_LYCANTROPE);
if (level > 0) {
for(u = f->units; u; u=u->nextF) {
if (rng_int()%100 < 2*level) {
ADDMSG(&u->faction->msgs, msg_message("becomewere",
"unit region", u, u->region));
ADDMSG(&u->faction->msgs,
msg_message("becomewere", "unit region", u, u->region));
fset(u, UFL_WERE);
}
}
}
}
}
#endif
/* Chaos */