forked from github/server
Einheit mit FOLGE-Befehl führt keinen langen Befehl aus obwohl führende Einheit sich nicht bewegt hat Verbesserung: Wenn NACH oder ROUTE nicht der gewählte lange Befehl sind, wird auch nciht gefolgt. Des weiteren: Folgende Einheiten mit at_follow werden ebenfalls verfolgt.
This commit is contained in:
parent
650a266254
commit
a970f3b883
|
@ -2505,24 +2505,42 @@ follow_unit(void)
|
||||||
|
|
||||||
if (a && !fval(u, UFL_MOVED)) {
|
if (a && !fval(u, UFL_MOVED)) {
|
||||||
unit * u2 = a->data.v;
|
unit * u2 = a->data.v;
|
||||||
|
boolean follow = false;
|
||||||
|
|
||||||
if (!u2 || u2->region!=r || !cansee(u->faction, r, u2, 0))
|
if (!u2 || u2->region!=r || !cansee(u->faction, r, u2, 0))
|
||||||
continue;
|
continue;
|
||||||
for (ord=u2->orders;ord;ord=ord->next) {
|
|
||||||
switch (get_keyword(ord)) {
|
switch (get_keyword(u2->thisorder)) {
|
||||||
case K_MOVE:
|
case K_MOVE:
|
||||||
case K_ROUTE:
|
case K_ROUTE:
|
||||||
case K_DRIVE:
|
case K_DRIVE:
|
||||||
case K_FOLLOW:
|
follow = true;
|
||||||
case K_PIRACY:
|
break;
|
||||||
fset(u, UFL_FOLLOWING);
|
default:
|
||||||
fset(u2, UFL_FOLLOWED);
|
for (ord=u2->orders;ord;ord=ord->next) {
|
||||||
set_order(&u->thisorder, NULL);
|
switch (get_keyword(ord)) {
|
||||||
|
case K_FOLLOW:
|
||||||
|
case K_PIRACY:
|
||||||
|
follow = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
continue;
|
break;
|
||||||
|
}
|
||||||
|
if (!follow) {
|
||||||
|
attrib * a2 = a_find(u2->attribs, &at_follow);
|
||||||
|
if (a2!=NULL) {
|
||||||
|
unit * u3 = a2->data.v;
|
||||||
|
follow = (u3 && u2->region==u2->region);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
if (follow) {
|
||||||
|
fset(u, UFL_FOLLOWING);
|
||||||
|
fset(u2, UFL_FOLLOWED);
|
||||||
|
set_order(&u->thisorder, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue