diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index 44ba35f4..96bd53e1 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -1098,25 +1098,28 @@ lnd_mar_dir(struct emp_qelem *list, int dir, natid actor) } } - return 0; + return QEMPTY(list); } int lnd_mar_gauntlet(struct emp_qelem *list, int interdict, natid actor) { struct ulist *mlp = (struct ulist *)list->q_back; - coord newx = mlp->unit.land.lnd_x; - coord newy = mlp->unit.land.lnd_y; + coord newx, newy; int stopping, visible; struct emp_qelem *qp, *next; struct ulist *llp; + if (CANT_HAPPEN(QEMPTY(list))) + return 1; + newx = mlp->unit.land.lnd_x; + newy = mlp->unit.land.lnd_y; stopping = lnd_sweep(list, 0, 1, actor); if (QEMPTY(list)) - return stopping; + return 1; stopping |= lnd_check_mines(list); if (QEMPTY(list)) - return stopping; + return 1; visible = 0; for (qp = list->q_back; qp != list; qp = next) { diff --git a/src/lib/subs/shpsub.c b/src/lib/subs/shpsub.c index 6905da00..7e61372e 100644 --- a/src/lib/subs/shpsub.c +++ b/src/lib/subs/shpsub.c @@ -876,23 +876,26 @@ shp_nav_dir(struct emp_qelem *list, int dir, natid actor) putship(mlp->unit.ship.shp_uid, &mlp->unit.ship); } - return 0; + return QEMPTY(list); } int shp_nav_gauntlet(struct emp_qelem *list, int interdict, natid actor) { struct ulist *mlp = (struct ulist *)list->q_back; - coord newx = mlp->unit.ship.shp_x; - coord newy = mlp->unit.ship.shp_y; + coord newx, newy; int stopping; + if (CANT_HAPPEN(QEMPTY(list))) + return 1; + newx = mlp->unit.ship.shp_x; + newy = mlp->unit.ship.shp_y; stopping = shp_sweep(list, 0, 0, actor); if (QEMPTY(list)) - return stopping; + return 1; stopping |= shp_check_mines(list); if (QEMPTY(list)) - return stopping; + return 1; if (interdict) stopping |= shp_interdict(list, newx, newy, actor);