- newx = xnorm(mlp->unit.ship.shp_x + dx);
- newy = ynorm(mlp->unit.ship.shp_y + dy);
- getsect(newx, newy, §);
- navigate = shp_check_nav(§, &mlp->unit.ship);
- if (navigate != CN_NAVIGABLE ||
- (sect.sct_own && actor != sect.sct_own &&
- getrel(getnatp(sect.sct_own), actor) < FRIENDLY)) {
- if (dchr[sect.sct_type].d_nav == NAV_CANAL &&
- !(((struct mchrstr *)mlp->chrp)->m_flags & M_CANAL) &&
- navigate == CN_LANDLOCKED)
- sprintf(dp,
- "is too large to fit into the canal system at %s",
- xyas(newx, newy, actor));
- else
- sprintf(dp, "can't go to %s", xyas(newx, newy, actor));
- if (together) {
- mpr(actor, "%s\n", dp);
- return 2;
- } else {
- shp_mess(dp, mlp);
- continue;
- }
+ switch (shp_check_nav(&mlp->unit.ship, §)) {
+ case SHP_STUCK_NOT:
+ move = 1;
+ break;
+ case SHP_STUCK_CANAL:
+ break;
+ default:
+ CANT_REACH();
+ /* fall through */
+ case SHP_STUCK_CONSTRUCTION:
+ case SHP_STUCK_IMPASSABLE:
+ mpr(actor, "can't go to %s\n", xyas(newx, newy, actor));
+ return 1;
+ }
+ }
+ if (!move) {
+ mpr(actor, "is too large to fit into the canal system at %s\n",
+ xyas(newx, newy, actor));
+ return 1;
+ }
+
+ for (qp = list->q_back; qp != list; qp = next) {
+ next = qp->q_back;
+ mlp = (struct ulist *)qp;
+ stuck = shp_check_nav(&mlp->unit.ship, §);
+ if (stuck == SHP_STUCK_CANAL) {
+ mpr(actor,
+ "%s is too large to fit into the canal system at %s"
+ " & stays in %s\n",
+ prship(&mlp->unit.ship), xyas(newx, newy, actor),
+ xyas(mlp->unit.ship.shp_x, mlp->unit.ship.shp_y, actor));
+ shp_nav_put_one(mlp);
+ continue;
+ } else if (CANT_HAPPEN(stuck != SHP_STUCK_NOT)) {
+ mpr(actor, "%s can't go to %s & stays in %s\n",
+ prship(&mlp->unit.ship), xyas(newx, newy, actor),
+ xyas(mlp->unit.ship.shp_x, mlp->unit.ship.shp_y, actor));
+ shp_nav_put_one(mlp);
+ continue;