]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/navi.c
Fix trailing whitespace
[empserver] / src / lib / commands / navi.c
index 491f335a475cd928af4424b48e47aad3857514f6..ddab374868fedfcfd3a31c1628bee7da035fd847 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, 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
@@ -26,7 +26,7 @@
  *  ---
  *
  *  navi.c: Navigate ships and such
- * 
+ *
  *  Known contributors to this file:
  *     Ken Stevens, 1995 (rewritten)
  *     Ron Koenderink, 2006-2007
@@ -34,7 +34,6 @@
 
 #include <config.h>
 
-#include <ctype.h>
 #include "commands.h"
 #include "map.h"
 #include "optlist.h"
@@ -54,7 +53,7 @@ navi(void)
     double minmob, maxmob;
     int together;
 
-    if (!snxtitem(&ni_ship, EF_SHIP, player->argp[1]))
+    if (!snxtitem(&ni_ship, EF_SHIP, player->argp[1], NULL))
        return RET_SYN;
     shp_sel(&ni_ship, &ship_list);
     shp_nav(&ship_list, &minmob, &maxmob, &together, player->cnum);
@@ -131,7 +130,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
            else
                skip = 0;
            sprintf(prompt, "<%.1f:%.1f: %s> ", *maxmob,
-                   *minmob, xyas(leader->x, leader->y, player->cnum)); 
+                   *minmob, xyas(leader->x, leader->y, player->cnum));
            cp = getstring(prompt, buf);
            /* Just in case any of our units were shelled while we were
             * at the prompt, we call shp_nav() or lnd_mar() again.
@@ -184,7 +183,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
            cp++;
            continue;
        }
-       ac = parse(cp, player->argp, NULL, scanspace, NULL);
+       ac = parse(cp, scanspace, player->argp, NULL, NULL, NULL);
        if (ac <= 1) {
            sprintf(dp, "%d", leader->uid);
            player->argp[1] = dp;
@@ -200,7 +199,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
             */
        case 'M':
            do_map(bmap_flag, leader->ef_type, player->argp[1],
-               player->argp[2]);
+                  player->argp[2]);
            skip = 1;
            continue;
        case 'f':
@@ -281,7 +280,6 @@ nav_map(int x, int y, int show_designations)
     struct nstr_sect ns;
     struct natstr *np;
     struct sctstr sect;
-    struct range range;
     int i;
     /* Note this is not re-entrant anyway, so we keep the buffers
        around */
@@ -308,7 +306,6 @@ nav_map(int x, int y, int show_designations)
     }
     snxtsct_dist(&ns, x, y, 1);
     np = getnatp(player->cnum);
-    xyrelrange(np, &ns.range, &range);
     blankfill(wmapbuf, &ns.range, 1);
     while (nxtsct(&ns, &sect)) {
        ptr = &wmap[ns.dy][ns.dx];
@@ -328,7 +325,7 @@ nav_map(int x, int y, int show_designations)
         * in which case they'll see that.
         * --ts
         */
-       *ptr = player->bmap[sctoff(sect.sct_x, sect.sct_y)];
+       *ptr = player->bmap[sect.sct_uid];
     }
     if (changed)
        writemap(player->cnum);