subs: Simplify move_in_land()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-07-23 23:16:07 +02:00
parent 1f0caf4aed
commit 36e3caf97e

View file

@ -2309,8 +2309,6 @@ move_in_land(int combat_mode, struct combat *off, struct emp_qelem *olist,
struct ulist *llp; struct ulist *llp;
char buf[512]; char buf[512];
if (QEMPTY(olist))
return;
for (qp = olist->q_forw; qp != olist; qp = next) { for (qp = olist->q_forw; qp != olist; qp = next) {
next = qp->q_forw; next = qp->q_forw;
llp = (struct ulist *)qp; llp = (struct ulist *)qp;
@ -2324,8 +2322,7 @@ move_in_land(int combat_mode, struct combat *off, struct emp_qelem *olist,
else else
llp->unit.land.lnd_ship = -1; llp->unit.land.lnd_ship = -1;
} }
if (QEMPTY(olist))
return;
if (def->type == EF_SECTOR) { if (def->type == EF_SECTOR) {
if (opt_INTERDICT_ATT) { if (opt_INTERDICT_ATT) {
lnd_sweep(olist, 0, 0, player->cnum); lnd_sweep(olist, 0, 0, player->cnum);
@ -2335,15 +2332,13 @@ move_in_land(int combat_mode, struct combat *off, struct emp_qelem *olist,
} else { } else {
sprintf(buf, "boards %s", prcom(0, def)); sprintf(buf, "boards %s", prcom(0, def));
} }
if (QEMPTY(olist))
return;
for (qp = olist->q_forw; qp != olist; qp = next) { for (qp = olist->q_forw; qp != olist; qp = next) {
next = qp->q_forw; next = qp->q_forw;
llp = (struct ulist *)qp; llp = (struct ulist *)qp;
lnd_print(player->cnum, llp, buf); lnd_print(player->cnum, llp, buf);
} }
if (QEMPTY(olist))
return;
lnd_put(olist); lnd_put(olist);
} }