]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/bridgefall.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / common / bridgefall.c
index 93534fa7eb72b33a25cf6ee72e4522d8b7f099dd..e321cba991007b3228a16549539dc27b45c058d4 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, 1998
  */
 
+#include <config.h>
+
 #include "misc.h"
-#include "var.h"
+#include "plague.h"
 #include "sect.h"
 #include "path.h"
 #include "file.h"
@@ -48,8 +50,8 @@
 void
 bridgefall(struct sctstr *sp, struct emp_qelem *list)
 {
-    register int i;
-    register int j;
+    int i;
+    int j;
     struct sctstr sect;
     struct sctstr bh_sect;
     int nx;
@@ -97,7 +99,6 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
     struct lndstr land;
     struct plnstr plane;
     struct nstr_item ni;
-    int mines;
     struct natstr *np;
 
     if (sp->sct_type == SCT_BTOWER)
@@ -118,7 +119,7 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
 
     /* Sink all the units */
     snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
-    while (nxtitem(&ni, (s_char *)&land)) {
+    while (nxtitem(&ni, &land)) {
        if (land.lnd_own == 0)
            continue;
        if (land.lnd_x != sp->sct_x || land.lnd_y != sp->sct_y)
@@ -138,7 +139,7 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
     }
     /* Sink all the planes */
     snxtitem_xy(&ni, EF_PLANE, sp->sct_x, sp->sct_y);
-    while (nxtitem(&ni, (s_char *)&plane)) {
+    while (nxtitem(&ni, &plane)) {
        if (plane.pln_own == 0)
            continue;
        if (plane.pln_x != sp->sct_x || plane.pln_y != sp->sct_y)
@@ -161,12 +162,11 @@ knockdown(struct sctstr *sp, struct emp_qelem *list)
        plane.pln_effic = 0;
        putplane(plane.pln_uid, &plane);
     }
-    /*
-     * save only the mines; zero the rest of the
-     * commodities.
-     */
-    mines = getvar(V_MINE, (caddr_t)sp, EF_SECTOR);
-    sp->sct_nv = 0;
-    if (mines > 0)
-       (void)putvar(V_MINE, mines, (caddr_t)sp, EF_SECTOR);
+    memset(sp->sct_item, 0, sizeof(sp->sct_item));
+    memset(sp->sct_del, 0, sizeof(sp->sct_del));
+    memset(sp->sct_dist, 0, sizeof(sp->sct_dist));
+    sp->sct_pstage = PLG_HEALTHY;
+    sp->sct_ptime = 0;
+    sp->sct_che = 0;
+    sp->sct_che_target = 0;
 }