]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/land.c
Update copyright notice
[empserver] / src / lib / subs / land.c
index d8b9409f0f83b90999d03fd59e5c47f000922810..5a2414777ca1354d9274cb76ba06ade5583b35db 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2004, 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.
  *
  *  ---
  *
  *     Steve McClure, 1996
  */
 
-#include "misc.h"
-#include "player.h"
-#include "var.h"
+#include <config.h>
+
 #include "file.h"
 #include "land.h"
-#include "ship.h"
-#include "xy.h"
-#include "nat.h"
+#include "lost.h"
+#include "misc.h"
 #include "nsc.h"
+#include "optlist.h"
 #include "plane.h"
+#include "player.h"
 #include "prototypes.h"
-#include "optlist.h"
+#include "ship.h"
 
 int
-lnd_postread(int n, s_char *ptr)
+lnd_postread(int n, void *ptr)
 {
-    struct lndstr *llp = (struct lndstr *)ptr;
+    struct lndstr *llp = ptr;
     struct shpstr theship;
     struct lndstr theland;
 
@@ -109,11 +109,10 @@ lnd_postread(int n, s_char *ptr)
     return 1;
 }
 
-/*ARGSUSED*/
 int
-lnd_prewrite(int n, s_char *ptr)
+lnd_prewrite(int n, void *ptr)
 {
-    struct lndstr *llp = (struct lndstr *)ptr;
+    struct lndstr *llp = ptr;
     struct lndstr land;
     struct lndstr *lp;
     struct plnstr *pp;
@@ -125,8 +124,8 @@ lnd_prewrite(int n, s_char *ptr)
     time(&llp->lnd_timestamp);
 
     if (llp->lnd_own && llp->lnd_effic < LAND_MINEFF) {
-       makelost(EF_LAND, llp->lnd_own, llp->lnd_uid, llp->lnd_x,
-                llp->lnd_y);
+       makelost(EF_LAND, llp->lnd_own, llp->lnd_uid,
+                llp->lnd_x, llp->lnd_y);
        llp->lnd_own = 0;
 
        getland(n, &land);
@@ -134,8 +133,8 @@ lnd_prewrite(int n, s_char *ptr)
        for (i = 0; NULL != (lp = getlandp(i)); i++) {
            if (lp->lnd_own && lp->lnd_land == n) {
                mpr(lp->lnd_own, "%s MIA!\n", prland(lp));
-               makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
-                        lp->lnd_y);
+               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;
@@ -146,8 +145,8 @@ lnd_prewrite(int n, s_char *ptr)
        for (i = 0; NULL != (pp = getplanep(i)); i++) {
            if (pp->pln_own && pp->pln_land == n) {
                mpr(pp->pln_own, "%s MIA!\n", prplane(pp));
-               makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
-                        pp->pln_y);
+               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;
@@ -164,16 +163,16 @@ lnd_prewrite(int n, s_char *ptr)
 }
 
 void
-lnd_init(int n, s_char *ptr)
+lnd_init(int n, void *ptr)
 {
-    struct lndstr *lp = (struct lndstr *)ptr;
+    struct lndstr *lp = ptr;
 
     lp->ef_type = EF_LAND;
     lp->lnd_uid = n;
     lp->lnd_own = 0;
 }
 
-s_char *
+char *
 prland(struct lndstr *lp)
 {
     return prbuf("%s #%d", lchr[(int)lp->lnd_type].l_name, lp->lnd_uid);