/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2004, 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
*
* ---
*
- * 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;
}
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;
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;