/*
* 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
#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)
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");
}
static int
cmd_sail_ship(struct nstr_item *nstr)
{
- s_char *cp;
+ char *cp;
struct shpstr ship;
char navpath[MAX_PATH_LEN];
int
sail(void)
{
- s_char *cp;
+ char *cp;
struct nstr_item nstr;
if (!opt_SAIL) {
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);
}