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

Function find_branch_room

src/mklev.c:1659–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1657
1658/* Find an unused room for a branch location. */
1659staticfn struct mkroom *
1660find_branch_room(coord *mp)
1661{
1662 struct mkroom *croom = 0;
1663
1664 if (svn.nroom == 0) {
1665 mazexy(mp); /* already verifies location */
1666 } else {
1667 croom = generate_stairs_find_room();
1668 assert(croom != NULL); /* Null iff nroom==0 which won't get here */
1669 if (!somexyspace(croom, mp))
1670 impossible("Can't place branch!");
1671 }
1672 return croom;
1673}
1674
1675/* Find the room for (x,y). Return null if not in a room. */
1676staticfn struct mkroom *

Callers 1

place_branchFunction · 0.85

Calls 4

mazexyFunction · 0.85
somexyspaceFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected