diff --git a/include/prototypes.h b/include/prototypes.h index 8afa40a9..0060d462 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -73,6 +73,7 @@ extern char *prsub(struct shpstr *); extern int check_trade(void); extern int ontradingblock(int, void *); extern void trdswitchown(int, void *, int); +extern int radar(short); /* Commands */ int acce(void); int add(void); @@ -145,6 +146,7 @@ int llook(void); int load(void); int look(void); int lost(void); +int lrad(void); int lrange(void); int lretr(void); int lsta(void); diff --git a/src/lib/commands/marc.c b/src/lib/commands/marc.c index 87f6cb62..f430d0c9 100644 --- a/src/lib/commands/marc.c +++ b/src/lib/commands/marc.c @@ -156,7 +156,7 @@ march(void) break; case 'r': player->argp[0] = "lradar"; - rada(); + radar(EF_LAND); skip = 1; player->btused++; break; diff --git a/src/lib/commands/navi.c b/src/lib/commands/navi.c index f74b30c9..c76c3810 100644 --- a/src/lib/commands/navi.c +++ b/src/lib/commands/navi.c @@ -179,7 +179,7 @@ navi(void) stopping |= shp_sweep(&ship_list, 1, 0, player->cnum); break; case 'r': - rada(); + radar(EF_SHIP); skip = 1; player->btused++; break; diff --git a/src/lib/commands/rada.c b/src/lib/commands/rada.c index 73d4dbb6..fa94b2c6 100644 --- a/src/lib/commands/rada.c +++ b/src/lib/commands/rada.c @@ -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); diff --git a/src/lib/player/empmod.c b/src/lib/player/empmod.c index e3676b72..419d3e28 100644 --- a/src/lib/player/empmod.c +++ b/src/lib/player/empmod.c @@ -142,7 +142,7 @@ struct cmndstr player_coms[] = { 1, load, C_MOD, NORM + CAP}, {"lookout ", 1, look, 0, NORM + CAP}, {"lost", 0, lost, 0, NORM}, - {"lradar ", 1, rada, 0, NORM + CAP}, + {"lradar ", 1, lrad, 0, NORM + CAP}, {"lrange ", 1, lrange, C_MOD, NORM + CAP}, {"lretreat [i|h|b|c]", 1, lretr, C_MOD, NORM + CAP},