#ifndef lint
static char *RCSid = "$Header: /users/empire/EMP/empmain/COMS/RCS/orig.c,v 1.3 89/05/27 23:40:52 emp-src Exp $";
#endif

/*
 * orig.c
 *
 * move your origin
 *
 * Shelley Louie, 1988
 */

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

orig()
{
	extern char *argp[];
	struct	sctstr sect;
	char	*p;
	coord	x, y;

	if ((p = getstarg(argp[1], "New origin location : ")) == 0) {
		return RET_SYN;
	}
	if (!sarg_xy(p, &x, &y))
		return RET_SYN;
	if (!getsect(x, y, &sect))
		return RET_SYN;
	pr(fmt("Origin at %s (old system) is now at 0,0 (new system).\n",
	       xyas(sect.sct_x, sect.sct_y, cnum)));
	NAT_SET(nat_xorg, cnum, sect.sct_x);
	NAT_SET(nat_yorg, cnum, sect.sct_y);
	return RET_OK;
}
