"Trotz Transport: 'Die Einheit transportiert uns nicht.'"

Einheiten auf See duerfen nicht transportieren.
This commit is contained in:
Enno Rehling 2007-02-13 08:19:38 +00:00
parent 88b041880c
commit b954d4a475
1 changed files with 19 additions and 16 deletions

View File

@ -1007,29 +1007,32 @@ init_transportation(void)
/* This calculates the weights of all transported units and /* This calculates the weights of all transported units and
* adds them to an internal counter which is used by travel () to * adds them to an internal counter which is used by travel () to
* calculate effective weight and movement. */ * calculate effective weight and movement. */
for (u=r->units; u; u=u->next) {
order * ord; if (!fval(r->terrain, SEA_REGION)) {
int w = 0; for (u=r->units; u; u=u->next) {
order * ord;
int w = 0;
for (ord = u->orders; ord; ord = ord->next) { for (ord = u->orders; ord; ord = ord->next) {
if (get_keyword(ord) == K_TRANSPORT) { if (get_keyword(ord) == K_TRANSPORT) {
init_tokens(ord); init_tokens(ord);
skip_token(); skip_token();
for (;;) { for (;;) {
unit * ut = getunit(r, u->faction); unit * ut = getunit(r, u->faction);
if (ut == NULL) break; if (ut == NULL) break;
if (get_keyword(ut->thisorder) == K_DRIVE && can_move(ut) && !fval(ut, UFL_LONGACTION) && !LongHunger(ut)) { if (get_keyword(ut->thisorder) == K_DRIVE && can_move(ut) && !fval(ut, UFL_LONGACTION) && !LongHunger(ut)) {
init_tokens(ut->thisorder); init_tokens(ut->thisorder);
skip_token(); skip_token();
if (getunit(r, ut->faction) == u) { if (getunit(r, ut->faction) == u) {
w += weight(ut); 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;
} }
} }
} }