From b954d4a4755f5c6cb7a80e24a5cb8a8f26c3e381 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 13 Feb 2007 08:19:38 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=988 "Trotz Transport: 'Die Einheit transportiert uns nicht.'" Einheiten auf See duerfen nicht transportieren. --- src/common/kernel/movement.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index c4d9b964f..4d980c444 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -1007,29 +1007,32 @@ init_transportation(void) /* This calculates the weights of all transported units and * adds them to an internal counter which is used by travel () to * calculate effective weight and movement. */ - for (u=r->units; u; u=u->next) { - order * ord; - int w = 0; + + if (!fval(r->terrain, SEA_REGION)) { + for (u=r->units; u; u=u->next) { + order * ord; + int w = 0; - for (ord = u->orders; ord; ord = ord->next) { - if (get_keyword(ord) == K_TRANSPORT) { - init_tokens(ord); - skip_token(); - for (;;) { - unit * ut = getunit(r, u->faction); + for (ord = u->orders; ord; ord = ord->next) { + if (get_keyword(ord) == K_TRANSPORT) { + init_tokens(ord); + skip_token(); + for (;;) { + unit * ut = getunit(r, u->faction); - if (ut == NULL) break; - if (get_keyword(ut->thisorder) == K_DRIVE && can_move(ut) && !fval(ut, UFL_LONGACTION) && !LongHunger(ut)) { - init_tokens(ut->thisorder); - skip_token(); - if (getunit(r, ut->faction) == u) { - w += weight(ut); + if (ut == NULL) break; + if (get_keyword(ut->thisorder) == K_DRIVE && can_move(ut) && !fval(ut, UFL_LONGACTION) && !LongHunger(ut)) { + init_tokens(ut->thisorder); + skip_token(); + if (getunit(r, ut->faction) == u) { + w += weight(ut); + } } } } } + if (w > 0) a_add(&u->attribs, a_new(&at_driveweight))->data.i = w; } - if (w > 0) a_add(&u->attribs, a_new(&at_driveweight))->data.i = w; } } }