]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/nuke.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / subs / nuke.c
index 6f2e7c8150a650e7b94f5372d07be12ad2c0dd28..68b0299fb94625252218cdec57392cad7b96d45c 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-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
  *     Steve McClure, 1996
  */
 
+#include <config.h>
+
 #include "misc.h"
 #include "player.h"
-#include "var.h"
 #include "nuke.h"
 #include "sect.h"
 #include "xy.h"
 #include "nsc.h"
 #include "file.h"
 #include "nat.h"
-#include "deity.h"
 #include "prototypes.h"
 
-/*ARGSUSED*/
 int
-nuk_postread(int n, s_char *ptr)
+nuk_postread(int n, void *ptr)
 {
-    struct nukstr *np = (struct nukstr *)ptr;
+    struct nukstr *np = ptr;
 
     if (np->nuk_uid != n) {
        logerror("nuk_postread: Error - %d != %d, zeroing.\n", np->nuk_uid,
@@ -59,11 +58,10 @@ nuk_postread(int n, s_char *ptr)
     return 1;
 }
 
-/*ARGSUSED*/
 int
-nuk_prewrite(int n, s_char *ptr)
+nuk_prewrite(int n, void *ptr)
 {
-    struct nukstr *np = (struct nukstr *)ptr;
+    struct nukstr *np = ptr;
     struct nukstr nuke;
 
     np->ef_type = EF_NUKE;
@@ -77,9 +75,9 @@ nuk_prewrite(int n, s_char *ptr)
 }
 
 void
-nuk_init(int n, s_char *ptr)
+nuk_init(int n, void *ptr)
 {
-    struct nukstr *np = (struct nukstr *)ptr;
+    struct nukstr *np = ptr;
 
     np->ef_type = EF_NUKE;
     np->nuk_uid = n;
@@ -121,14 +119,15 @@ nuk_add(coord x, coord y, int type, int num)
        ef_extend(EF_NUKE, 10);
        memset(&nuke, 0, sizeof(struct nukstr));
        nuke.nuk_uid = nuk_uid;
+    }
+    if (nuke.nuk_own == 0) {
        nuke.nuk_ship = -1;
-       nuke.nuk_n = 0;
+       nuke.nuk_x = x;
+       nuke.nuk_y = y;
+       nuke.nuk_own = own;
        makenotlost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x,
                    nuke.nuk_y);
     }
-    nuke.nuk_x = x;
-    nuke.nuk_y = y;
-    nuke.nuk_own = own;
     nuke.nuk_types[type] += num;
     nuke.nuk_n += num;