]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/detonate.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / subs / detonate.c
index 3265410d1643adb7d0f7480fdfcafbb34426dc84..426c32b34530bd78eecb23910fd21681cc1ba236 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.
  *
  *  ---
  *
@@ -31,6 +31,8 @@
  *     Steve McClure, 1998-2000
  */
 
+#include <config.h>
+
 #include "misc.h"
 #include "player.h"
 #include "xy.h"
@@ -43,7 +45,6 @@
 #include "news.h"
 #include "plane.h"
 #include "nsc.h"
-#include "var.h"
 #include "optlist.h"
 #include "prototypes.h"
 
@@ -108,11 +109,11 @@ detonate(struct plnstr *pp, int x, int y)
        if (sect.sct_x == x && sect.sct_y == y)
            retval = damage;
        if (opt_FALLOUT) {
-           if (opt_NEUTRON && (ncp->n_flags & N_NEUT))
+           if (ncp->n_flags & N_NEUT)
                fallout += damage * 30;
            else
                fallout += damage * 3;
-           sect.sct_fallout = fallout;
+           sect.sct_fallout = MIN(fallout, FALLOUT_MAX);
        }
        if (damage > 100) {
            makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, sect.sct_y);
@@ -146,7 +147,7 @@ detonate(struct plnstr *pp, int x, int y)
        }
     }
     snxtitem_dist(&ni, EF_PLANE, x, y, rad);
-    while (nxtitem(&ni, (caddr_t)&plane)) {
+    while (nxtitem(&ni, &plane)) {
        /* Nukes falling on water affect only 1 sector */
        if ((plane.pln_x != x) && issea)
            continue;
@@ -197,7 +198,7 @@ detonate(struct plnstr *pp, int x, int y)
        putplane(ni.cur, &plane);
     }
     snxtitem_dist(&ni, EF_LAND, x, y, rad);
-    while (nxtitem(&ni, (caddr_t)&land)) {
+    while (nxtitem(&ni, &land)) {
        /* Nukes falling on water affect only 1 sector */
        if ((land.lnd_x != x) && issea)
            continue;
@@ -244,7 +245,7 @@ detonate(struct plnstr *pp, int x, int y)
        putland(land.lnd_uid, &land);
     }
     snxtitem_dist(&ni, EF_SHIP, x, y, rad);
-    while (nxtitem(&ni, (caddr_t)&ship)) {
+    while (nxtitem(&ni, &ship)) {
        /* Nukes falling on water affect only 1 sector */
        if ((ship.shp_x != x) && issea)
            continue;
@@ -285,7 +286,7 @@ detonate(struct plnstr *pp, int x, int y)
        putship(ship.shp_uid, &ship);
     }
     snxtitem_dist(&ni, EF_NUKE, x, y, rad);
-    while (nxtitem(&ni, (caddr_t)&nuke)) {
+    while (nxtitem(&ni, &nuke)) {
        /* Nukes falling on water affect only 1 sector */
        if ((nuke.nuk_x != x) && issea)
            continue;