From 2fe73a38f7aa77d80298549d1990f3f0e72eaa8e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 30 Jun 2004 21:29:17 +0000 Subject: [PATCH] - http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000151 FOLGE SCHIFF gibt massenhaft Fehlermeldungen. --- src/common/kernel/kernel.vcproj | 3 -- src/common/kernel/movement.c | 62 +++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/common/kernel/kernel.vcproj b/src/common/kernel/kernel.vcproj index d463de41a..e5e97aac7 100644 --- a/src/common/kernel/kernel.vcproj +++ b/src/common/kernel/kernel.vcproj @@ -218,9 +218,6 @@ - - diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index 3857c0712..5b7c2449f 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -2130,39 +2130,49 @@ move_hunters(void) region *r; for (r = regions; r; r = r->next) { - unit * u; - for (u = r->units; u;) { - unit *u2 = u->next; - order * ord; - param_t p; + unit ** up = &r->units, * u; + for (u=r->units; u; u=u->next) freset(u, FL_DH); - for (ord=u->orders;ord;ord=ord->next) { - if (get_keyword(ord) == K_FOLLOW) { - if (attacked(u)) { - cmistake(u, ord, 52, MSG_MOVE); - break; - } else if (!can_move(u)) { - cmistake(u, ord, 55, MSG_MOVE); - break; - } + while (*up!=NULL) { + unit * u = *up; - init_tokens(ord); - skip_token(); - p = getparam(u->faction->locale); - if (p != P_SHIP) { - if (p != P_UNIT) { - cmistake(u, ord, 240, MSG_MOVE); + if (!fval(u, FL_DH)) { + order * ord; + + fset(u, FL_DH); + + for (ord=u->orders;ord;ord=ord->next) { + if (get_keyword(ord) == K_FOLLOW) { + param_t p; + + init_tokens(ord); + skip_token(); + p = getparam(u->faction->locale); + if (p != P_SHIP) { + if (p != P_UNIT) { + cmistake(u, ord, 240, MSG_MOVE); + } + break; } - break; - } - if (!fval(u, UFL_LONGACTION) && !fval(u, UFL_HUNGER) && hunt(u)) { - u2 = r->units; - break; + /* wir folgen definitiv einem Schiff. */ + + if (fval(u, UFL_LONGACTION)) { + cmistake(u, ord, 52, MSG_MOVE); + break; + } else if (!can_move(u)) { + cmistake(u, ord, 55, MSG_MOVE); + break; + } + + if (!fval(u, UFL_LONGACTION) && !fval(u, UFL_HUNGER) && hunt(u)) { + up = &r->units; + break; + } } } } - u = u2; + if (*up==u) up=&u->next; } } }