#ifndef lint
static char *RCSid = "$Header: /users/empire/EMP/empmain/SUBS/RCS/ship.c,v 1.2 89/06/27 01:33:49 griffith Exp $";
#endif

/*
 * ship.c
 *
 * ship pre-write data massage
 *
 * Dave Pare, 1989
 */

#include "misc.h"
#include "nat.h"
#include "ship.h"
#include "deity.h"
#include "xy.h"

/*ARGSUSED*/
shp_postread(n, ptr)
	int	n;
	char	*ptr;
{
	struct	shpstr *sp = (struct shpstr *)ptr;

	owner = (god || sp->shp_own == cnum);
	return 1;
}

int
shp_prewrite(n, ptr)
	int	n;
	char	*ptr;
{
	struct	shpstr *sp = (struct shpstr *) ptr;
	char	*p;

	if (sp->shp_effic < 20) {
#ifdef	SHIPNAMES
		p = fmt("%s %s(#%d) sunk!\n", mchr[sp->shp_type].m_name,
			sp->shp_name, n);
#else
		p = fmt("%s #%d sunk!\n", mchr[sp->shp_type].m_name, n);
#endif	SHIPNAMES
		if (sp->shp_own && (sp->shp_own != cnum))
			wu(0, sp->shp_own, p);
		pr(p);
		sp->shp_own = 0;
	}
	return 1;
}
