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.2 2003/06/17 04:25:24 dillon Exp $ */
20 if(utcnt < UTSZ) utcnt++;
21 if(utpnt == UTSZ) utpnt = 0;
22 utrack[utpnt].x = u.ux;
23 utrack[utpnt].y = u.uy;
28 gettrack(x,y) int x,y; {
32 for(i = utpnt-1; cnt--; i--){
33 if(i == -1) i = UTSZ-1;
35 dist = (x-tc.x)*(x-tc.x) + (y-tc.y)*(y-tc.y);
37 return(dist ? &(utrack[i]) : 0);