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.
* Check for a multitude of problems
*/
getsect(endsect.sct_x, endsect.sct_y, &chksect);
+ if (amount <= 0) {
+ getsect(start.sct_x, start.sct_y, &start);
+ sect.sct_flags &= ~MOVE_IN_PROGRESS;
+ putsect(§);
+ return RET_FAIL;
+ }
if (chksect.sct_type == '.') {
pr("Bridge disappeared!\n");
getsect(start.sct_x, start.sct_y, &start);
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