forked from github/server
BUG 1786 Fehlschlag ZERSTÖRE Gerüst
Einheiten ohne Personen können nichts zerstören (das ist OK), da aber Zerstöre vor Rekrutiere und zusammen mit Gib abgearbeitet wird, kann eine Temp-Einheit normalerweise nichts Zerstören, auch wenn sie in der Auswertung Pesonen hat. Wenn sie Personen übergeben bekommt hängt es von der genauen Reihenfolger der Einheiten in der Region ab. Daher habe ich Zerstöre nach Gib, Vergessen und Rekrutieren geschoben.
This commit is contained in:
parent
4cfa1ec7c3
commit
9d102fd069
|
@ -1164,17 +1164,10 @@ void economics(region * r)
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
order *ord;
|
order *ord;
|
||||||
bool destroyed = false;
|
|
||||||
if (u->number > 0) {
|
if (u->number > 0) {
|
||||||
for (ord = u->orders; ord; ord = ord->next) {
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
keyword_t kwd = getkeyword(ord);
|
keyword_t kwd = getkeyword(ord);
|
||||||
if (kwd == K_DESTROY) {
|
if (kwd == K_GIVE) {
|
||||||
if (!destroyed) {
|
|
||||||
if (destroy_cmd(u, ord) != 0)
|
|
||||||
ord = NULL;
|
|
||||||
destroyed = true;
|
|
||||||
}
|
|
||||||
} else if (kwd == K_GIVE) {
|
|
||||||
give_cmd(u, ord);
|
give_cmd(u, ord);
|
||||||
} else if (kwd == K_FORGET) {
|
} else if (kwd == K_FORGET) {
|
||||||
forget_cmd(u, ord);
|
forget_cmd(u, ord);
|
||||||
|
@ -1207,6 +1200,27 @@ void economics(region * r)
|
||||||
if (recruitorders)
|
if (recruitorders)
|
||||||
expandrecruit(r, recruitorders);
|
expandrecruit(r, recruitorders);
|
||||||
remove_empty_units_in_region(r);
|
remove_empty_units_in_region(r);
|
||||||
|
|
||||||
|
for (u = r->units; u; u = u->next) {
|
||||||
|
order *ord;
|
||||||
|
bool destroyed = false;
|
||||||
|
if (u->number > 0) {
|
||||||
|
for (ord = u->orders; ord; ord = ord->next) {
|
||||||
|
keyword_t kwd = getkeyword(ord);
|
||||||
|
if (kwd == K_DESTROY) {
|
||||||
|
if (!destroyed) {
|
||||||
|
if (destroy_cmd(u, ord) != 0)
|
||||||
|
ord = NULL;
|
||||||
|
destroyed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (u->orders == NULL) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
Loading…
Reference in New Issue