/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* orde.c: Turn on/off autonavigation
- *
+ *
* Known contributors to this file:
* Chad Zabel, 1994
* Steve McClure, 2000
#include <config.h>
-#include <ctype.h>
#include "commands.h"
#include "item.h"
#include "optlist.h"
* ORDER <ship> l[evel] <field> <start/end> <comm> <level>
*
* New syntax:
- * qorder <ship> display cargo levels
- * sorder <ship> display statistical info
+ * qorder <ship> display cargo levels
+ * sorder <ship> display statistical info
*/
int
char buf[1024];
char prompt[128];
- if (!snxtitem(&nb, EF_SHIP, player->argp[1]))
+ if (!snxtitem(&nb, EF_SHIP, player->argp[1], NULL))
return RET_SYN;
while (!player->aborted && nxtitem(&nb, (&ship))) {
if (!player->owner || ship.shp_own == 0)
if (!orders) {
p = getstarg(player->argp[4], "Second dest? ", buf);
- if (!p || !*p || !strcmp(p, "-")) {
+ if (!p)
+ return RET_FAIL;
+ if (!*p || !strcmp(p, "-")) {
orders = 1;
pr("A one-way order has been accepted.\n");
} else if (!strncmp(p, "s", 1)) {
break;
}
- /* to keep sub in range of our arrays
+ /* to keep sub in range of our arrays
subtract 1 so the new range is 0-(TMAX-1)
*/
sub = sub - 1;;
ship.shp_autonav |= AN_LOADING;
- /* swap variables, this keeps
+ /* swap variables, this keeps
the load_it() procedure happy. CZ
*/
tcord = ship.shp_destx[0];
struct nstr_item nb;
struct shpstr ship;
- if (!snxtitem(&nb, EF_SHIP, player->argp[1]))
+ if (!snxtitem(&nb, EF_SHIP, player->argp[1], NULL))
return RET_SYN;
while (nxtitem(&nb, (&ship))) {
if (!player->owner || ship.shp_own == 0)
struct shpstr ship;
char buf[1024];
- if (!snxtitem(&nb, EF_SHIP, player->argp[1]))
+ if (!snxtitem(&nb, EF_SHIP, player->argp[1], NULL))
return RET_SYN;
while (nxtitem(&nb, (&ship))) {
if (!player->owner || ship.shp_own == 0)