(radar): New, moved functionality from rada() except ef_type determination.

(rada): Call radar() with EF_SHIP.
(lrad): New, call radar() with EF_LAND.
(empmod[]): Call lrad() for lradar command.
(march, navi): Call radar() with appropriate type.
This commit is contained in:
Ron Koenderink 2006-08-16 01:16:30 +00:00
parent ed88f3140d
commit a9a9957a27
5 changed files with 16 additions and 7 deletions

View file

@ -38,8 +38,18 @@
#include "optlist.h"
#include "empobj.h"
int rada(void)
{
return radar(EF_SHIP);
}
int lrad(void)
{
return radar(EF_LAND);
}
int
rada(void)
radar(short type)
{
char *cp;
double tf;
@ -48,11 +58,8 @@ rada(void)
struct nstr_sect ns;
union empobj_storage item;
char buf[1024];
short type;
char prompt[80];
type = player->argp[0][0] == 'l' ? EF_LAND : EF_SHIP;
sprintf(prompt, "Radar from (%s # or sector(s)) : ", ef_nameof(type));
cp = getstarg(player->argp[1], prompt, buf);