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

Function pos_to_room

src/mklev.c:1676–1687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1674
1675/* Find the room for (x,y). Return null if not in a room. */
1676staticfn struct mkroom *
1677pos_to_room(coordxy x, coordxy y)
1678{
1679 int i;
1680 struct mkroom *curr;
1681
1682 for (curr = svr.rooms, i = 0; i < svn.nroom; curr++, i++)
1683 if (inside_room(curr, x, y))
1684 return curr;
1685 ;
1686 return (struct mkroom *) 0;
1687}
1688
1689/* If given a branch, randomly place a special stair or portal. */
1690void

Callers 1

place_branchFunction · 0.85

Calls 1

inside_roomFunction · 0.85

Tested by

no test coverage detected