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

Function m_bad_boulder_spot

src/sp_lev.c:1863–1881  ·  view source on GitHub ↗

attempt to screen out locations where a mimic-as-boulder shouldn't occur */

Source from the content-addressed store, hash-verified

1861
1862/* attempt to screen out locations where a mimic-as-boulder shouldn't occur */
1863staticfn boolean
1864m_bad_boulder_spot(coordxy x, coordxy y)
1865{
1866 struct rm *lev;
1867
1868 /* avoid trap locations */
1869 if (t_at(x, y))
1870 return TRUE;
1871 /* try to avoid locations which already have a boulder (this won't
1872 actually work; we get called before objects have been placed...) */
1873 if (sobj_at(BOULDER, x, y))
1874 return TRUE;
1875 /* avoid closed doors */
1876 lev = &levl[x][y];
1877 if (IS_DOOR(lev->typ) && (lev->doormask & (D_CLOSED | D_LOCKED)) != 0)
1878 return TRUE;
1879 /* spot is ok */
1880 return FALSE;
1881}
1882
1883staticfn int
1884pm_to_humidity(struct permonst *pm)

Callers 1

create_monsterFunction · 0.85

Calls 2

t_atFunction · 0.85
sobj_atFunction · 0.85

Tested by

no test coverage detected