]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/sail.c
Update copyright notice.
[empserver] / src / lib / commands / sail.c
index f4e13e590ecfe81ce9edd738738651c93178d917..47ed3fe9661349cbb2796dd52ae210211e8427af 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
 #include <config.h>
 
 #include <ctype.h>
-#include "misc.h"
-#include "player.h"
-#include "ship.h"
-#include "path.h"
-#include "xy.h"
-#include "nsc.h"
-#include "file.h"
 #include "commands.h"
 #include "optlist.h"
+#include "path.h"
+#include "ship.h"
 
 static int
 show_sail(struct nstr_item *nstr)
@@ -68,7 +63,7 @@ show_sail(struct nstr_item *nstr)
        pr("   %3d     ", ship.shp_mobquota);
        pr("   %3d   ", ship.shp_follow);
        if (ship.shp_path[0]) {
-           pr(ship.shp_path);
+           pr("%s", ship.shp_path);
        } else if ((ship.shp_autonav & AN_AUTONAV)) {
            pr("Has orders");
        }
@@ -112,7 +107,7 @@ cmd_unsail_ship(struct nstr_item *nstr)
 static int
 cmd_sail_ship(struct nstr_item *nstr)
 {
-    s_char *cp;
+    char *cp;
     struct shpstr ship;
     char navpath[MAX_PATH_LEN];
 
@@ -143,7 +138,7 @@ cmd_sail_ship(struct nstr_item *nstr)
 int
 sail(void)
 {
-    s_char *cp;
+    char *cp;
     struct nstr_item nstr;
 
     if (!opt_SAIL) {
@@ -153,11 +148,9 @@ sail(void)
     if (!snxtitem(&nstr, EF_SHIP, player->argp[1]))
        return RET_SYN;
     cp = player->argp[2];
-    if ((*player->argp[0] == 'q') /*qsail command */ ||(cp && *cp == 'q')) {
-       return show_sail(&nstr);
-    } else if (*player->argp[0] == 'u' /*unsail command */
-              || (cp && *cp == '-')) {
+    if (*player->argp[0] == 'u' || (cp && !strcmp(cp, "-")))
        return cmd_unsail_ship(&nstr);
-    } else
-       return cmd_sail_ship(&nstr);
+    if (cp && *cp == 'q')
+       return show_sail(&nstr);
+    return cmd_sail_ship(&nstr);
 }