]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/rada.c
Fix trailing whitespace
[empserver] / src / lib / commands / rada.c
index fa94b2c6e559ff52e9b4a85a2c500b356f438364..af91ceaa0faf289503c3def40aef4e671504575a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, 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"
 
-int rada(void)
+int
+rada(void)
 {
     return radar(EF_SHIP);
 }
 
-int lrad(void)
+int
+lrad(void)
 {
     return radar(EF_LAND);
 }
@@ -60,9 +61,12 @@ radar(short type)
     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)) {
@@ -86,7 +90,7 @@ radar(short type)
     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;
        }
@@ -108,7 +112,8 @@ radar(short type)
                    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));