/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2004, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * 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.
*
* ---
*
* sate.c: Do satellite maps/reports.
- *
+ *
* Known contributors to this file:
* Edward M. Rynes Esq, 1988
* Ken Stevens, 1995
* Steve McClure, 1998-2000
*/
-#include "misc.h"
-#include "player.h"
-#include "xy.h"
-#include "plane.h"
-#include "nsc.h"
-#include "file.h"
-#include "nat.h"
+#include <config.h>
+
+#include <ctype.h>
#include "commands.h"
#include "optlist.h"
+#include "plane.h"
int
sate(void)
{
+ static int sct_shp_or_lnd[] = { EF_SECTOR, EF_SHIP, EF_LAND, EF_BAD };
double tech;
int pln_uid;
struct plnstr plane;
return RET_FAIL;
}
- if (!(plane.pln_flags & PLN_LAUNCHED)) {
+ if (!pln_is_in_orbit(&plane)) {
pr("%s isn't in orbit\n", prplane(&plane));
return RET_FAIL;
}
return RET_FAIL;
}
if (player->argp[2]) {
- switch (*player->argp[2]) {
- case 'l':
- type = EF_LAND;
- break;
- case 's':
- if (*(player->argp[2] + 1) == 'e')
- type = EF_SECTOR;
- else
- type = EF_SHIP;
- break;
- default:
+ type = ef_byname_from(player->argp[2], sct_shp_or_lnd);
+ if (type < 0) {
return RET_SYN;
}
}