/* shpsub.c */
extern void shp_sel(struct nstr_item *, struct emp_qelem *);
extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);
-extern int shp_sweep(struct emp_qelem *, int, natid);
+extern int shp_sweep(struct emp_qelem *, int, int, natid);
extern char *shp_path(int, struct shpstr *, char *);
extern void shp_put(struct emp_qelem *, natid);
extern void shp_list(struct emp_qelem *);
} else if (cp[-1] == 'i') {
shp_list(&ship_list);
} else {
- stopping |= shp_sweep(&ship_list, 1, player->cnum);
+ stopping |= shp_sweep(&ship_list, 1, 0, player->cnum);
}
continue;
} else if (*cp == 'r' || *cp == 'l' || *cp == 's') {
}
int
-shp_sweep(struct emp_qelem *ship_list, int verbose, natid actor)
+shp_sweep(struct emp_qelem *ship_list, int verbose, int takemob, natid actor)
{
struct emp_qelem *qp;
struct emp_qelem *next;
prship(&mlp->ship));
continue;
}
- if (mlp->mobil <= 0.0) {
+ if (takemob && mlp->mobil <= 0.0) {
if (verbose)
mpr(actor, "%s is out of mobility!\n", prship(&mlp->ship));
continue;
prship(&mlp->ship));
continue;
}
- mlp->mobil -= shp_mobcost(&mlp->ship);
- mlp->ship.shp_mobil = (int)mlp->mobil;
+ if (takemob) {
+ mlp->mobil -= shp_mobcost(&mlp->ship);
+ mlp->ship.shp_mobil = (int)mlp->mobil;
+ }
putship(mlp->ship.shp_uid, &mlp->ship);
if (!(mines = sect.sct_mines))
continue;
}
if (QEMPTY(list))
return stopping;
- stopping |= shp_sweep(list, 0, actor);
+ stopping |= shp_sweep(list, 0, 0, actor);
if (QEMPTY(list))
return stopping;
stopping |= shp_check_mines(list);