"Merkwürdiges Supermegamonster frisst Region leer"
fixed error in mistletoe-zombie creation
This commit is contained in:
Enno Rehling 2008-08-28 19:01:36 +00:00
parent 3c0d17e568
commit 17bcb2d7a7
1 changed files with 31 additions and 36 deletions

View File

@ -225,7 +225,7 @@ void
destroyfaction(faction * f) destroyfaction(faction * f)
{ {
region *rc; region *rc;
unit *u; unit *u = f->units;
faction *ff; faction *ff;
if (!f->alive) return; if (!f->alive) return;
@ -237,25 +237,19 @@ destroyfaction(faction * f)
free(bm); free(bm);
} }
for (u=f->units;u;u=u->nextF) {
region * r = u->region;
/* give away your stuff, make zombies if you cannot (quest items) */
while (u) { while (u) {
/* give away your stuff, make zombies if you cannot (quest items) */
int result = gift_items(u, GIFT_FRIENDS|GIFT_PEASANTS); int result = gift_items(u, GIFT_FRIENDS|GIFT_PEASANTS);
if (result!=0) { if (result!=0) {
unit * zombie = u; unit * zombie = u;
u = u->nextF; u = u->nextF;
make_zombie(zombie); make_zombie(zombie);
} else { } else {
break; region * r = u->region;
}
}
if (u==NULL) continue;
if (!fval(r->terrain, SEA_REGION) && !!playerrace(u->race)) { if (!fval(r->terrain, SEA_REGION) && !!playerrace(u->race)) {
const race * rc = u->race; const race * rc = u->race;
int m = rmoney(u->region); int m = rmoney(r);
if ((rc->ec_flags & ECF_REC_ETHEREAL)==0) { if ((rc->ec_flags & ECF_REC_ETHEREAL)==0) {
int p = rpeasants(u->region); int p = rpeasants(u->region);
@ -276,9 +270,10 @@ destroyfaction(faction * f)
} }
m += get_money(u); m += get_money(u);
rsetmoney(r, m); rsetmoney(r, m);
} }
set_number(u, 0); set_number(u, 0);
u=u->nextF;
}
} }
f->alive = 0; f->alive = 0;
/* no way! f->units = NULL; */ /* no way! f->units = NULL; */