1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.track.c - version 1.0.2 */
3 /* $FreeBSD: src/games/hack/hack.track.c,v 1.4 1999/11/16 10:26:38 marcel Exp $ */
4 /* $DragonFly: src/games/hack/hack.track.c,v 1.3 2006/08/21 19:45:32 pavalos Exp $ */
24 if(utcnt < UTSZ) utcnt++;
25 if(utpnt == UTSZ) utpnt = 0;
26 utrack[utpnt].x = u.ux;
27 utrack[utpnt].y = u.uy;
32 gettrack(int x, int y)
37 for(i = utpnt-1; cnt--; i--){
38 if(i == -1) i = UTSZ-1;
40 dst = (x-tc.x)*(x-tc.x) + (y-tc.y)*(y-tc.y);
42 return(dst ? &(utrack[i]) : 0);