Let march sub-command 'm' sweep own and allied landmines
This commit is contained in:
parent
0b7fba038a
commit
f11071f3b7
1 changed files with 11 additions and 10 deletions
|
@ -524,8 +524,14 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sweep landmines with engineers in LAND_LIST for ACTOR.
|
||||||
|
* If EXPLICIT is non-zero, this is for an explicit sweep command from
|
||||||
|
* a player. Else it's an automatic "on the move" sweep.
|
||||||
|
* If TAKEMOB is non-zero, require and charge mobility.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lnd_sweep(struct emp_qelem *land_list, int verbose, int takemob,
|
lnd_sweep(struct emp_qelem *land_list, int explicit, int takemob,
|
||||||
natid actor)
|
natid actor)
|
||||||
{
|
{
|
||||||
struct emp_qelem *qp;
|
struct emp_qelem *qp;
|
||||||
|
@ -538,26 +544,21 @@ lnd_sweep(struct emp_qelem *land_list, int verbose, int takemob,
|
||||||
next = qp->q_back;
|
next = qp->q_back;
|
||||||
llp = (struct ulist *)qp;
|
llp = (struct ulist *)qp;
|
||||||
if (!(((struct lchrstr *)llp->chrp)->l_flags & L_ENGINEER)) {
|
if (!(((struct lchrstr *)llp->chrp)->l_flags & L_ENGINEER)) {
|
||||||
if (verbose)
|
if (explicit)
|
||||||
mpr(actor, "%s is not an engineer!\n",
|
mpr(actor, "%s is not an engineer!\n",
|
||||||
prland(&llp->unit.land));
|
prland(&llp->unit.land));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (takemob && llp->mobil < 0.0) {
|
if (takemob && llp->mobil < 0.0) {
|
||||||
if (verbose)
|
if (explicit)
|
||||||
lnd_stays(actor, "is out of mobility", llp);
|
lnd_stays(actor, "is out of mobility", llp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
getsect(llp->unit.land.lnd_x, llp->unit.land.lnd_y, §);
|
getsect(llp->unit.land.lnd_x, llp->unit.land.lnd_y, §);
|
||||||
if (relations_with(sect.sct_oldown, actor) == ALLIED) {
|
if (!explicit && relations_with(sect.sct_oldown, actor) == ALLIED)
|
||||||
if (verbose)
|
|
||||||
mpr(actor,
|
|
||||||
"%s is in a sector completely owned by you or an ally. Don't bother digging up mines there!\n",
|
|
||||||
prland(&llp->unit.land));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
if (SCT_MINES_ARE_SEAMINES(§)) {
|
if (SCT_MINES_ARE_SEAMINES(§)) {
|
||||||
if (verbose)
|
if (explicit)
|
||||||
mpr(actor, "%s is in a %s sector. No landmines there!\n",
|
mpr(actor, "%s is in a %s sector. No landmines there!\n",
|
||||||
prland(&llp->unit.land), dchr[sect.sct_type].d_name);
|
prland(&llp->unit.land), dchr[sect.sct_type].d_name);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue