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

Function somexyspace

src/mkroom.c:743–756  ·  view source on GitHub ↗

like somexy(), but returns an accessible location */

Source from the content-addressed store, hash-verified

741
742/* like somexy(), but returns an accessible location */
743boolean
744somexyspace(struct mkroom* croom, coord *c)
745{
746 int trycnt = 0;
747 boolean okay;
748
749 do {
750 okay = somexy(croom, c) && isok(c->x, c->y) && !occupied(c->x, c->y)
751 && (levl[c->x][c->y].typ == ROOM
752 || levl[c->x][c->y].typ == CORR
753 || levl[c->x][c->y].typ == ICE);
754 } while (trycnt++ < 100 && !okay);
755 return okay;
756}
757
758/*
759 * Search for a special room given its type (zoo, court, etc...)

Callers 8

fill_zooFunction · 0.85
vault_teleFunction · 0.85
mvault_teleFunction · 0.85
fill_ordinary_roomFunction · 0.85
find_branch_roomFunction · 0.85
mktrapFunction · 0.85
generate_stairsFunction · 0.85
find_okay_roomposFunction · 0.85

Calls 3

somexyFunction · 0.85
isokFunction · 0.85
occupiedFunction · 0.85

Tested by

no test coverage detected