]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/radmap.c
Update copyright notice.
[empserver] / src / lib / subs / radmap.c
index 9c45fb7d3c6b7c07a77c9385c346ccb6f1e75869..7227a6a00823229c22a4439555de03e3dc5e8d13 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2004, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
 #include "plane.h"
 #include "file.h"
 #include "nsc.h"
-#include "deity.h"
 #include "prototypes.h"
 #include "optlist.h"
 
+static void radmap2(int, int, int, int, int, double, int);
+
 void
 radmap(int cx, int cy, int eff, int range, double seesub)
 {
@@ -63,14 +64,14 @@ radmapupd(int own, int cx, int cy, int eff, int range, double seesub)
 }
 
 /* More dynamic world sized buffers.  We create 'em once, and then
- * never again.  No need to keep creating/tearint apart.  We may
+ * never again.  No need to keep creating/tearing apart.  We may
  * want to do this in other places too where it doesn't matter. */
 static s_char **rad;
 static s_char *radbuf;
 static s_char **vis;
 static s_char *visbuf;
 
-void
+static void
 radmap2(int owner,
        int cx, int cy, int eff, int range, double seesub, int pr_flag)
 {
@@ -110,7 +111,7 @@ radmap2(int owner,
        return;
     }
 
-    bzero((s_char *)visbuf, (WORLD_Y * (WORLD_X + 1)));
+    memset(visbuf, 0, (WORLD_Y * (WORLD_X + 1)));
     range = (int)(range * (eff / 100.0));
     if (range < 1)
        range = 1;
@@ -120,8 +121,10 @@ radmap2(int owner,
     snxtsct_dist(&ns, cx, cy, range);
     blankfill((s_char *)radbuf, &ns.range, 1);
     while (nxtsct(&ns, &sect)) {
-       if (sect.sct_own == owner ||
-           (sect.sct_type <= SCT_RURAL && sect.sct_type != SCT_SANCT)
+       if (sect.sct_own == owner
+           || sect.sct_type == SCT_WATER
+           || sect.sct_type == SCT_MOUNT
+           || sect.sct_type == SCT_WASTE
            || ns.curdist <= range / 3)
            rad[ns.dy][ns.dx] = dchr[sect.sct_type].d_mnem;
        else
@@ -133,7 +136,7 @@ radmap2(int owner,
     if (!pr_flag)
        return;
     snxtitem_dist(&ni, EF_PLANE, cx, cy, range);
-    while (nxtitem(&ni, (caddr_t)&plane)) {
+    while (nxtitem(&ni, &plane)) {
        if (plane.pln_own == 0)
            continue;
        /* Used to have 'ghosts' when scanning whole world --ts */
@@ -146,7 +149,7 @@ radmap2(int owner,
        }
     }
     snxtitem_dist(&ni, EF_SHIP, cx, cy, range);
-    while (nxtitem(&ni, (caddr_t)&ship)) {
+    while (nxtitem(&ni, &ship)) {
        if (ship.shp_own == 0)
            continue;
        /* Used to have 'ghosts' when scanning whole world --ts */