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

Function bydoor

src/mklev.c:1749–1775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1747}
1748
1749staticfn boolean
1750bydoor(coordxy x, coordxy y)
1751{
1752 int typ;
1753
1754 if (isok(x + 1, y)) {
1755 typ = levl[x + 1][y].typ;
1756 if (IS_DOOR(typ) || typ == SDOOR)
1757 return TRUE;
1758 }
1759 if (isok(x - 1, y)) {
1760 typ = levl[x - 1][y].typ;
1761 if (IS_DOOR(typ) || typ == SDOOR)
1762 return TRUE;
1763 }
1764 if (isok(x, y + 1)) {
1765 typ = levl[x][y + 1].typ;
1766 if (IS_DOOR(typ) || typ == SDOOR)
1767 return TRUE;
1768 }
1769 if (isok(x, y - 1)) {
1770 typ = levl[x][y - 1].typ;
1771 if (IS_DOOR(typ) || typ == SDOOR)
1772 return TRUE;
1773 }
1774 return FALSE;
1775}
1776
1777/* see whether it is allowable to create a door at [x,y] */
1778int

Callers 3

good_rm_wall_doorposFunction · 0.85
okdoorFunction · 0.85
find_okay_roomposFunction · 0.85

Calls 1

isokFunction · 0.85

Tested by

no test coverage detected