/*
* 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
*
* ---
*
- * 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));
}
}
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;
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;
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;
}
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)",