get a track coord on or next to x,y and last tracked by hero, returns null if no such track */
| 39 | /* get a track coord on or next to x,y and last tracked by hero, |
| 40 | returns null if no such track */ |
| 41 | coord * |
| 42 | gettrack(coordxy x, coordxy y) |
| 43 | { |
| 44 | int cnt, ndist; |
| 45 | coord *tc; |
| 46 | cnt = utcnt; |
| 47 | for (tc = &utrack[utpnt]; cnt--;) { |
| 48 | if (tc == utrack) |
| 49 | tc = &utrack[UTSZ - 1]; |
| 50 | else |
| 51 | tc--; |
| 52 | ndist = distmin(x, y, tc->x, tc->y); |
| 53 | |
| 54 | if (ndist <= 1) |
| 55 | return (ndist ? tc : 0); |
| 56 | } |
| 57 | return (coord *) 0; |
| 58 | } |
| 59 | #endif /* !SFCTOOL */ |
| 60 | |
| 61 | /* return TRUE if x,y has hero tracks on it */ |