MCPcopy Create free account
hub / github.com/NetHack/NetHack / xytodir

Function xytodir

src/cmd.c:3846–3855  ·  view source on GitHub ↗

convert an x,y pair into a direction code */

Source from the content-addressed store, hash-verified

3844
3845/* convert an x,y pair into a direction code */
3846int
3847xytodir(int x, int y)
3848{
3849 int dd;
3850
3851 for (dd = 0; dd < N_DIRS; dd++)
3852 if (x == xdir[dd] && y == ydir[dd])
3853 return dd;
3854 return DIR_ERR;
3855}
3856
3857/* convert a direction code into an x,y pair */
3858void

Callers 15

hitum_cleaveFunction · 0.85
landing_spotFunction · 0.85
test_moveFunction · 0.85
move_out_of_boundsFunction · 0.85
use_pick_axe2Function · 0.85
zap_digFunction · 0.85
dog_moveFunction · 0.85
conjoined_pitsFunction · 0.85
adj_nonconjoined_pitFunction · 0.85
boomhitFunction · 0.85
dobuzzFunction · 0.85
hero_behind_chokepointFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_moveFunction · 0.68