Exploit, ZERSTÖRE strassen mehrfach
This commit is contained in:
Enno Rehling 2004-05-21 22:10:18 +00:00
parent e9e35c0e9e
commit a75accfcd0
1 changed files with 45 additions and 36 deletions

View File

@ -1260,51 +1260,60 @@ maintain_buildings(boolean crash)
void void
economics(void) economics(void)
{ {
region *r; region *r;
unit *u; unit *u;
strlist *S; strlist *S;
/* Geben vor Selbstmord (doquit)! Hier alle unmittelbaren Befehle. /* Geben vor Selbstmord (doquit)! Hier alle unmittelbaren Befehle.
* Rekrutieren vor allen Einnahmequellen. Bewachen JA vor Steuern * Rekrutieren vor allen Einnahmequellen. Bewachen JA vor Steuern
* eintreiben. */ * eintreiben. */
for (r = regions; r; r = r->next) if (r->units) { for (r = regions; r; r = r->next) if (r->units) {
request *recruitorders = NULL; request *recruitorders = NULL;
for (u = r->units; u; u = u->next) { for (u = r->units; u; u = u->next) {
for (S = u->orders; S; S = S->next) { for (S = u->orders; S; S = S->next) {
switch (igetkeyword(S->s, u->faction->locale)) { strlist ** slist = &S->next;
switch (igetkeyword(S->s, u->faction->locale)) {
case K_DESTROY:
destroy(r, u, S->s);
while (*slist) {
strlist * scur = *slist;
const char * cmd = scur->s;
if (igetkeyword(cmd, u->faction->locale)==K_DESTROY) {
*slist = scur->next;
scur->next = NULL;
freestrlist(scur);
} else slist = &scur->next;
}
break;
case K_DESTROY: case K_GIVE:
destroy(r, u, S->s); case K_LIEFERE:
break; dogive(r, u, S, 0);
break;
case K_GIVE: case K_FORGET:
case K_LIEFERE: forgetskill(u);
dogive(r, u, S, 0); break;
break;
case K_FORGET: }
forgetskill(u); }
break; }
/* RECRUIT orders */
} for (u = r->units; u; u = u->next) {
} for (S = u->orders; S; S = S->next) {
} if (igetkeyword(S->s, u->faction->locale) == K_RECRUIT) {
/* RECRUIT orders */ recruit(r, u, S, &recruitorders);
break;
}
}
}
for (u = r->units; u; u = u->next) { if (recruitorders) expandrecruit(r, recruitorders);
for (S = u->orders; S; S = S->next) {
if (igetkeyword(S->s, u->faction->locale) == K_RECRUIT) {
recruit(r, u, S, &recruitorders);
break;
}
}
}
if (recruitorders) expandrecruit(r, recruitorders); }
}
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */