From 3316243651e794e157478ab7423253e981fc0674 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 10 Apr 2004 11:05:34 +0000 Subject: [PATCH] =?UTF-8?q?N=C3=A4chstes=20mal=20compilieren=20wir=20das,?= =?UTF-8?q?=20ehe=20wir=20committen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/movement.c | 19 +++++++++---------- src/res/eressea.xml | 1 - 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index 1eb3129fd..1bd31f878 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -447,14 +447,16 @@ travelthru(unit * u, region * r) } static void -leave_trail(ship * sh, region **route) +leave_trail(unit * u, region **route, region * to) { region **ri = route; - + ship * sh = u->ship; + while (*ri) { - region *r = *ri; - direction_t dir = reldirection(*ri, *rn); - attrib * a = a_find((*ri)->attribs, &at_traveldir_new); + region * r = *ri++; + region * rn = *ri?*ri:to; + direction_t dir = reldirection(r, rn); + attrib * a = a_find(r->attribs, &at_traveldir_new); traveldir * td = NULL; while (a!=NULL) { @@ -464,7 +466,7 @@ leave_trail(ship * sh, region **route) } if (a!=NULL) { - a = a_add(&((*ri)->attribs), a_new(&at_traveldir_new)); + a = a_add(&(r->attribs), a_new(&at_traveldir_new)); td = (traveldir *)a->data.v; td->no = sh->no; } @@ -472,7 +474,6 @@ leave_trail(ship * sh, region **route) td->age = 2; travelthru(u, r); - ++ri; } } @@ -481,8 +482,6 @@ move_ship(ship * sh, region * from, region * to, region ** route) { unit **iunit = &from->units; unit **ulist = &to->units; - direction_t dir; - attrib *a; boolean trail = (route==NULL); if (from!=to) { @@ -496,7 +495,7 @@ move_ship(ship * sh, region * from, region * to, region ** route) if (u->ship == sh) { if (!trail) { - leave_trail(sh, from, to, route); + leave_trail(u, route, to); trail=true; } if (from!=to) { diff --git a/src/res/eressea.xml b/src/res/eressea.xml index b81768921..5fc1f02c0 100644 --- a/src/res/eressea.xml +++ b/src/res/eressea.xml @@ -4,7 +4,6 @@ Localization -