MCPcopy Index your code
hub / github.com/NetHack/NetHack / furniture_present

Function furniture_present

src/hack.c:3481–3495  ·  view source on GitHub ↗

check whether room contains a particular type of furniture */

Source from the content-addressed store, hash-verified

3479
3480/* check whether room contains a particular type of furniture */
3481staticfn boolean
3482furniture_present(int furniture, int roomno)
3483{
3484 int x, y, lx, ly, hx, hy;
3485 struct mkroom *sroom = &svr.rooms[roomno];
3486
3487 ly = sroom->ly, hy = sroom->hy;
3488 lx = sroom->lx; hx = sroom->hx;
3489 /* the inside_room() check handles irregularly shaped rooms */
3490 for (y = ly; y <= hy; ++y)
3491 for (x = lx; x <= hx; ++x)
3492 if (levl[x][y].typ == furniture && inside_room(sroom, x, y))
3493 return TRUE;
3494 return FALSE;
3495}
3496
3497char *
3498in_rooms(coordxy x, coordxy y, int typewanted)

Callers 1

check_special_roomFunction · 0.85

Calls 1

inside_roomFunction · 0.85

Tested by

no test coverage detected