#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/subs/neigh.c,v 2.0 1995/01/25 19:58:54 empire Exp $";
#endif

/*
 * neigh.c
 *
 * return true if neighbor
 *
 * from PSL Empire, 1985
 */

#include "misc.h"
#include "sect.h"
#include "path.h"
#include "file.h"
#include "nat.h"

int
neigh(x, y, own)
	coord	x;
	coord	y;
	natid	own;
{
	register int i;
	struct	sctstr sect;

	for (i = DIR_FIRST; i <= DIR_LAST; i++) {
		getsect(x + diroff[i][0], y + diroff[i][1], &sect);
		if (sect.sct_own == own)
			return 1;
	}
	return 0;
}
