]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/lostsub.c
Update copyright notice.
[empserver] / src / lib / subs / lostsub.c
index c6eafd23e9ae72fe73989826a4d0ae83310c9350..3e932c213cde8552116016223343d75a16735690 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-2007, 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, 1997
  */
 
-#include "misc.h"
-#include "player.h"
+#include <config.h>
+
 #include "file.h"
-#include "land.h"
-#include "ship.h"
-#include "nsc.h"
 #include "lost.h"
-#include "prototypes.h"
+
+static int findlost(short, natid, short, coord, coord, int);
 
 void
-makelost(char type, natid owner, short int id, coord x, coord y)
+makelost(short type, natid owner, short id, coord x, coord y)
 {
     struct loststr lost;
     int n;
@@ -66,7 +64,7 @@ makelost(char type, natid owner, short int id, coord x, coord y)
 }
 
 void
-makenotlost(char type, natid owner, short int id, coord x, coord y)
+makenotlost(short type, natid owner, short id, coord x, coord y)
 {
     struct loststr lost;
     int n;
@@ -80,20 +78,21 @@ makenotlost(char type, natid owner, short int id, coord x, coord y)
     putlost(n, &lost);
 }
 
-int
-findlost(char type, natid owner, short int id, coord x, coord y, int free)
-
-
 
-
-
-         /* Give me the item of a free slot */
+/*
+ * Find a suitable slot in the lost file.
+ * If a record for TYPE, OWNER, ID, X, Y exists, return its index.
+ * Else if FREE is non-zero, return the index of an unused record if
+ * there is one.
+ * Else return -1.
+ */
+static int
+findlost(short type, natid owner, short id, coord x, coord y, int free)
 {
     struct loststr lost;
     int n;
     int freeslot = -1;
 
-/* Find a free slot, or find this item again */
     for (n = 0; getlost(n, &lost); n++) {
        if (!lost.lost_owner && freeslot == -1 && free == 1)
            freeslot = n;