]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/ship.c
Update copyright notice
[empserver] / src / lib / subs / ship.c
index 29019dc31410190a6891fafd1779645bac029618..dcdf68143871de76a7f75fbcd626bc5f24fe7f90 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, 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
@@ -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.
  *
  *  ---
  *
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
 #include "file.h"
-#include "ship.h"
 #include "land.h"
-#include "plane.h"
+#include "lost.h"
+#include "misc.h"
 #include "nsc.h"
-#include "prototypes.h"
 #include "optlist.h"
+#include "plane.h"
+#include "player.h"
+#include "prototypes.h"
+#include "ship.h"
 
-/*ARGSUSED*/
 int
-shp_postread(int n, s_char *ptr)
+shp_postread(int n, void *ptr)
 {
-    struct shpstr *sp = (struct shpstr *)ptr;
+    struct shpstr *sp = ptr;
 
     if (sp->shp_uid != n) {
-       logerror("shp_postread: Error - %d != %d, zeroing.\n", sp->shp_uid,
-                n);
+       logerror("shp_postread: Error - %d != %d, zeroing.\n",
+                sp->shp_uid, n);
        memset(sp, 0, sizeof(struct shpstr));
     }
 
@@ -63,9 +63,9 @@ shp_postread(int n, s_char *ptr)
 }
 
 int
-shp_prewrite(int n, s_char *ptr)
+shp_prewrite(int n, void *ptr)
 {
-    struct shpstr *sp = (struct shpstr *)ptr;
+    struct shpstr *sp = ptr;
     struct shpstr ship;
     struct lndstr *lp;
     struct plnstr *pp;
@@ -86,9 +86,6 @@ shp_prewrite(int n, s_char *ptr)
        for (i = 0; NULL != (lp = getlandp(i)); i++) {
            if (lp->lnd_own && lp->lnd_ship == n) {
                mpr(lp->lnd_own, "%s sunk!\n", prland(lp));
-               makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
-                        lp->lnd_y);
-               lp->lnd_own = 0;
                lp->lnd_effic = 0;
                lp->lnd_ship = -1;
                lp->lnd_land = -1;
@@ -98,9 +95,6 @@ shp_prewrite(int n, s_char *ptr)
        for (i = 0; NULL != (pp = getplanep(i)); i++) {
            if (pp->pln_own && pp->pln_ship == n) {
                mpr(pp->pln_own, "%s sunk!\n", prplane(pp));
-               makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
-                        pp->pln_y);
-               pp->pln_own = 0;
                pp->pln_effic = 0;
                pp->pln_ship = -1;
                pp->pln_land = -1;
@@ -116,16 +110,16 @@ shp_prewrite(int n, s_char *ptr)
 }
 
 void
-shp_init(int n, s_char *ptr)
+shp_init(int n, void *ptr)
 {
-    struct shpstr *sp = (struct shpstr *)ptr;
+    struct shpstr *sp = ptr;
 
     sp->ef_type = EF_SHIP;
     sp->shp_uid = n;
     sp->shp_own = 0;
 }
 
-s_char *
+char *
 prship(struct shpstr *sp)
 {
     return prbuf("%s %s(#%d)",