Skip to content

Commit

Permalink
remove bad assumption
Browse files Browse the repository at this point in the history
units on ships are not all at the end of the list, or ordered.
  • Loading branch information
ennorehling committed Dec 6, 2020
1 parent e4e06df commit e23d5e6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void move_ship(ship * sh, region * from, region * to, region_list * route)
leave_trail(sh, from, route);
}

if (route != NULL) {
if (route != NULL && from->units) {
unit** iunit = &from->units;
unit** ulist = &to->units;
unit* ufirst = NULL;
Expand All @@ -658,9 +658,6 @@ void move_ship(ship * sh, region * from, region * to, region_list * route)
produceexp(u, SK_SAILING, u->number);
}
}
else if (ufirst) {
break;
}
else {
iunit = &u->next;
}
Expand Down

0 comments on commit e23d5e6

Please sign in to comment.