(move, explore): Return early when interdiction destroys everything

moved.  Without that, loyalty computation divided by zero and crashed
when moving civilians to a sector without civilians.  Found and
debugged by Jeff Cotter.  Closes #1005005.
This commit is contained in:
Markus Armbruster 2004-08-13 10:05:32 +00:00
parent 9549adefdc
commit 73308d9c57
2 changed files with 13 additions and 0 deletions

View file

@ -269,6 +269,13 @@ move(void)
pr("%d mob left in %s\n", left,
xyas(start.sct_x, start.sct_y, player->cnum));
if (amount <= 0) {
getsect(x, y, &start);
start.sct_flags &= ~MOVE_IN_PROGRESS;
putsect(&start);
return RET_OK;
}
/* If the sector that things are going to is no longer
owned by the player, and was the starting sector,
try to find somewhere to dump the stuff. If nowhere