http://eressea.upb.de/mantis/view.php?id=341

Einheiten in Regionen mit FAHRENden Einheiten bewegen sich u.U. nicht.
This commit is contained in:
Enno Rehling 2004-12-23 00:07:32 +00:00
parent c8e4e0fcae
commit 353d2775c8
1 changed files with 9 additions and 4 deletions

View File

@ -2347,6 +2347,7 @@ movement(void)
region * r = regions; region * r = regions;
while (r!=NULL) { while (r!=NULL) {
unit ** up = &r->units; unit ** up = &r->units;
boolean repeat = false;
while (*up) { while (*up) {
unit *u = *up; unit *u = *up;
@ -2381,13 +2382,17 @@ movement(void)
if (u->region==r) { if (u->region==r) {
/* not moved, use next unit */ /* not moved, use next unit */
up = &u->next; up = &u->next;
} else if (*up && (*up)->region!=r) { } else {
/* moved the upcoming unit along with u (units on ships or followers, if (*up && (*up)->region!=r) {
* for example). must start from the beginning again */ /* moved the upcoming unit along with u (units on ships or followers,
up = &r->units; * for example). must start from the beginning again immediately */
up = NULL;
}
repeat = true;
} }
/* else *up is already the next unit */ /* else *up is already the next unit */
} }
if (repeat) continue;
if (ships==0) { if (ships==0) {
/* Abtreiben von beschädigten, unterbemannten, überladenen Schiffen */ /* Abtreiben von beschädigten, unterbemannten, überladenen Schiffen */
drifting_ships(r); drifting_ships(r);