]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/sail.c
Fix trailing whitespace
[empserver] / src / lib / commands / sail.c
index 0e3fdf05544d1b46960981519fb38a68ffdc4163..27a47e14aa558ffcfde810345e44294bfa1e3a6c 100644 (file)
@@ -26,7 +26,7 @@
  *  ---
  *
  *  sail.c: Set sail path for leaders
- * 
+ *
  *  Known contributors to this file:
  *     Robert Forsman
  */
@@ -110,7 +110,7 @@ cmd_sail_ship(struct nstr_item *nstr)
     struct shpstr ship;
     char navpath[MAX_PATH_LEN];
 
-    while (!player->aborted && nxtitem(nstr, &ship)) {
+    while (nxtitem(nstr, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
        if ((ship.shp_autonav & AN_AUTONAV) &&
@@ -123,13 +123,13 @@ cmd_sail_ship(struct nstr_item *nstr)
           xyas(ship.shp_x, ship.shp_y, ship.shp_own));
        cp = getpath(navpath, player->argp[2],
                     ship.shp_x, ship.shp_y, 0, 0, P_SAILING);
+       if (!cp)
+           return RET_FAIL;
        if (!check_ship_ok(&ship))
            continue;
-       if (!player->aborted) {
-           strncpy(ship.shp_path, cp, sizeof(ship.shp_path) - 2);
-           ship.shp_mission = 0;
-           putship(ship.shp_uid, &ship);
-       }
+       strncpy(ship.shp_path, cp, sizeof(ship.shp_path) - 2);
+       ship.shp_mission = 0;
+       putship(ship.shp_uid, &ship);
     }
     return RET_OK;
 }
@@ -144,7 +144,7 @@ sail(void)
        pr("The SAIL option is not enabled, so this command is not valid.\n");
        return RET_FAIL;
     }
-    if (!snxtitem(&nstr, EF_SHIP, player->argp[1]))
+    if (!snxtitem(&nstr, EF_SHIP, player->argp[1], NULL))
        return RET_SYN;
     cp = player->argp[2];
     if (*player->argp[0] == 'u' || (cp && !strcmp(cp, "-")))