(fuel, load, nav_loadship): Use it.
extern void shp_put(struct emp_qelem *, natid);
extern void shp_list(struct emp_qelem *);
extern int shp_check_nav(struct sctstr *);
+extern int sect_has_dock(struct sctstr *);
extern int shp_hardtarget(struct shpstr *);
extern void shp_view(struct emp_qelem *);
extern int shp_nav_one_sector(struct emp_qelem *, int, natid, int);
mp = &mchr[(int)item.ship.shp_type];
harbor = 0;
- if (sect.sct_type == SCT_HARBR
- || IS_BIG_CITY(sect.sct_type)) {
+ if (sect_has_dock(§)) {
harbor = 1;
oil_amt = sect.sct_item[I_OIL];
pet_amt = sect.sct_item[I_PETROL];
(ship.shp_own != player->cnum))
continue;
if (!player->owner &&
- sect.sct_type != SCT_HARBR &&
- !IS_BIG_CITY(sect.sct_type))
+ !sect_has_dock(§))
continue;
if (!sect.sct_own)
continue;
xyas(ship.shp_x, ship.shp_y, player->cnum));
continue;
}
- if (sect.sct_type != SCT_HARBR &&
- !IS_BIG_CITY(sect.sct_type)) {
+ if (!sect_has_dock(§)) {
if (noisy)
pr("Sector %s is not a harbor%s%s.\n",
xyas(ship.shp_x, ship.shp_y, player->cnum),
return CN_NAVIGABLE;
}
+int
+sect_has_dock(struct sctstr *sect)
+{
+ switch (dchr[sect->sct_type].d_nav) {
+ case NAV_02:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
static int
shp_count(struct emp_qelem *list, int wantflags, int nowantflags, int x,
int y)
didsomething[i] = 1;
continue;
}
- if (sectp->sct_type != SCT_HARBR &&
- !IS_BIG_CITY(sectp->sct_type)) {
+ if (!sect_has_dock(sectp)) {
/* we can only load in harbors */
didsomething[i] = 1;
continue;