forked from github/server
Bug 2616: FOLGE schiesst über das Ziel hinaus.
This commit is contained in:
parent
1c358b9982
commit
c82b3b27dd
|
@ -2227,6 +2227,7 @@ int follow_ship(unit * u, order * ord)
|
||||||
int moves, id, speed;
|
int moves, id, speed;
|
||||||
char command[256];
|
char command[256];
|
||||||
direction_t dir;
|
direction_t dir;
|
||||||
|
ship *sh;
|
||||||
|
|
||||||
if (fval(u, UFL_NOTMOVING)) {
|
if (fval(u, UFL_NOTMOVING)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2251,10 +2252,10 @@ int follow_ship(unit * u, order * ord)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sh = findship(id);
|
||||||
dir = hunted_dir(rc->attribs, id);
|
dir = hunted_dir(rc->attribs, id);
|
||||||
|
|
||||||
if (dir == NODIRECTION) {
|
if (dir == NODIRECTION) {
|
||||||
ship *sh = findship(id);
|
|
||||||
if (sh == NULL || sh->region != rc) {
|
if (sh == NULL || sh->region != rc) {
|
||||||
cmistake(u, ord, 20, MSG_MOVE);
|
cmistake(u, ord, 20, MSG_MOVE);
|
||||||
}
|
}
|
||||||
|
@ -2278,7 +2279,7 @@ int follow_ship(unit * u, order * ord)
|
||||||
speed = maxspeed;
|
speed = maxspeed;
|
||||||
}
|
}
|
||||||
rc = rconnect(rc, dir);
|
rc = rconnect(rc, dir);
|
||||||
while (rc && moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION) {
|
while (rc && rc != sh->region && moves < speed && (dir = hunted_dir(rc->attribs, id)) != NODIRECTION) {
|
||||||
const char *loc = LOC(u->faction->locale, directions[dir]);
|
const char *loc = LOC(u->faction->locale, directions[dir]);
|
||||||
sbs_strcat(&sbcmd, " ");
|
sbs_strcat(&sbcmd, " ");
|
||||||
sbs_strcat(&sbcmd, loc);
|
sbs_strcat(&sbcmd, loc);
|
||||||
|
|
Loading…
Reference in New Issue