#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/commands/trea.c,v 2.0 1995/01/25 19:23:25 empire Exp $";
#endif /* not lint */

/*
 * trea.c
 *
 * look at current treaties
 *
 * from PSL Empire, 1985
 */

#include "misc.h"
#include "player.h"
#include "xy.h"
#include "nsc.h"
#include "nat.h"
#include "treaty.h"
#include "file.h"

trea()
{
	struct	trtstr treaty;
	struct	nstr_item nstr;
	int	ntreaty;

	if (!snxtitem(&nstr, EF_TREATY, player->argp[1]))
		return RET_SYN;
	pr("\t... %s Treaty Report ...\n", cname(player->cnum));
	ntreaty = 0;
	while (nxtitem(&nstr, (s_char *)&treaty)) {
		if (distrea(nstr.cur, &treaty) > 0)
			ntreaty++;
	}
	if (!ntreaty)
		pr("No treaties found.\n");
	else
		pr("%d treat%s\n", ntreaty, iesplur(ntreaty));
	return RET_OK;
}
