Callers changed to print it themselves.
But print the first "boards" message before plane takeover instead of
after, in take_def().
extern double defense_val(struct lndstr *);
extern int lnd_reaction_range(struct lndstr *);
extern void lnd_print(struct ulist *, char *);
-extern void lnd_delete(struct ulist *, char *);
+extern void lnd_delete(struct ulist *);
extern int lnd_take_casualty(int, struct ulist *, int);
extern void lnd_submil(struct lndstr *, int);
extern void lnd_takemob(struct emp_qelem *, double);
pr(" and was killed in the attempt.\n");
llp->unit.land.lnd_effic = 0;
putland(llp->unit.land.lnd_uid, &llp->unit.land);
- lnd_delete(llp, NULL);
+ lnd_delete(llp);
} else {
wu(0, def->own, "%s spy spotted in %s.\n",
cname(player->cnum), xyas(def->x, def->y,
w = n;
}
if (w < 0) {
- lnd_delete(llp, "is in a sector not owned by you");
+ lnd_print(llp, "is in a sector not owned by you");
+ lnd_delete(llp);
continue;
}
ototal += attack_val(combat_mode, &llp->unit.land) *
if (lp->lnd_own != player->cnum) {
sprintf(buf, "was destroyed and is no longer a part of the %s",
att_mode[combat_mode]);
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
return 0;
}
if (lp->lnd_x != llp->x || lp->lnd_y != llp->y) {
sprintf(buf,
"left to fight another battle and is no longer a part of the %s",
att_mode[combat_mode]);
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
return 0;
}
if (lp->lnd_effic < llp->eff) {
if (lp->lnd_effic < LAND_MINEFF) {
sprintf(buf, "was destroyed and is no longer a part of the defense");
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
return 0;
}
if (lp->lnd_x != def->x || lp->lnd_y != def->y) {
- lnd_delete(llp,
- "left to go fight another battle and is no longer a part of the defense");
+ lnd_print(llp,
+ "left to go fight another battle and is no longer a part of the defense");
+ lnd_delete(llp);
return 0;
}
llp = (struct ulist *)qp;
if (llp->unit.land.lnd_ship >= 0) {
llp->unit.land.lnd_effic = 0;
- lnd_delete(llp, "cannot return to the ship, and dies!");
+ lnd_print(llp, "cannot return to the ship, and dies!");
+ lnd_delete(llp);
}
}
}
xyas(llp->x, llp->y, llp->unit.land.lnd_own));
llp->unit.land.lnd_x = llp->x;
llp->unit.land.lnd_y = llp->y;
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
}
}
if (def->type == EF_SHIP) {
llp->unit.land.lnd_ship = def->shp_uid;
sprintf(buf, "boards %s", prcom(0, def));
+ lnd_print(llp, buf);
delete_me = llp;
} else {
llp->unit.land.lnd_ship = -1;
sprintf(buf, "moves in to occupy %s",
xyas(def->x, def->y, player->cnum));
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
}
}
putland(land.lnd_uid, &land);
}
if (delete_me)
- lnd_delete(delete_me, buf);
+ lnd_delete(delete_me);
att_get_combat(def, 0);
return 1;
}
sprintf(buf, "stays in %s",
xyas(llp->unit.land.lnd_x, llp->unit.land.lnd_y,
player->cnum));
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
if (QEMPTY(olist))
return;
sprintf(buf, "stays in %s",
xyas(llp->unit.land.lnd_x, llp->unit.land.lnd_y,
player->cnum));
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
return;
}
}
void
-lnd_delete(struct ulist *llp, char *s)
+lnd_delete(struct ulist *llp)
{
- if (s)
- lnd_print(llp, s);
putland(llp->unit.land.lnd_uid, &llp->unit.land);
emp_remque((struct emp_qelem *)llp);
free(llp);
combat_mode ? att_mode[combat_mode] : "defending",
xyas(llp->unit.land.lnd_x, llp->unit.land.lnd_y,
llp->unit.land.lnd_own));
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
/* Since we killed the unit, we killed all the mil on it */
return taken;
} else {
sprintf(buf, "retreats at %d%% efficiency to %s!",
llp->unit.land.lnd_effic,
xyas(bx, by, llp->unit.land.lnd_own));
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
} else { /* attacking from a sector */
sprintf(buf, "leaves the battlefield at %d%% efficiency",
else
llp->unit.land.lnd_mobil -= (int)llp->mobil;
llp->mobil = 0.0;
- lnd_delete(llp, buf);
+ lnd_print(llp, buf);
+ lnd_delete(llp);
}
}
if (nowhere_to_go) {
llp->unit.land.lnd_effic -= 10;
lnd_submil(&llp->unit.land,
((struct lchrstr *)llp->chrp)->l_item[I_MILIT] / 10);
- if (llp->unit.land.lnd_effic < LAND_MINEFF)
- lnd_delete(llp, "has nowhere to retreat, and dies!");
- else
+ if (llp->unit.land.lnd_effic < LAND_MINEFF) {
+ lnd_print(llp, "has nowhere to retreat, and dies!");
+ lnd_delete(llp);
+ } else
lnd_print(llp,
"has nowhere to retreat and takes extra losses!");
}
pr("%s was shot and killed.\n", prland(&llp->unit.land));
llp->unit.land.lnd_effic = 0;
putland(llp->unit.land.lnd_uid, &llp->unit.land);
- lnd_delete(llp, NULL);
+ lnd_delete(llp);
}
}
}