/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2007, 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
* ---
*
* rada.c: Do radar from a ship/unit/sector
- *
+ *
* Known contributors to this file:
* Ron Koenderink, 2006
*/
#include <config.h>
-#include <ctype.h>
#include "commands.h"
#include "optlist.h"
#include "empobj.h"
char buf[1024];
char prompt[80];
+ if (CANT_HAPPEN(type != EF_LAND && type != EF_SHIP))
+ type = EF_SHIP;
+
sprintf(prompt, "Radar from (%s # or sector(s)) : ", ef_nameof(type));
cp = getstarg(player->argp[1], prompt, buf);
-
+
if (cp == 0)
return RET_SYN;
switch (sarg_type(cp)) {
case NS_LIST:
case NS_GROUP:
/* assumes a NS_LIST return is a unit no */
- if (!snxtitem(&ni, type, cp)) {
+ if (!snxtitem(&ni, type, cp, NULL)) {
pr("Specify at least one %s\n", ef_nameof(type));
return RET_SYN;
}
pr("Units on ships can't use radar!\n");
continue;
}
- tech = techfact(item.land.lnd_tech, item.land.lnd_spy);
+ tech = techfact(item.land.lnd_tech,
+ lchr[item.land.lnd_type].l_spy);
}
pr("%s at ", obj_nameof(&item.gen));