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

Function is_valid_travelpt

src/hack.c:1525–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1523}
1524
1525boolean
1526is_valid_travelpt(coordxy x, coordxy y)
1527{
1528 int tx = u.tx;
1529 int ty = u.ty;
1530 boolean ret;
1531 int glyph = glyph_at(x,y);
1532
1533 if (u_at(x, y))
1534 return TRUE;
1535 if (isok(x,y) && glyph_is_cmap(glyph) && S_stone == glyph_to_cmap(glyph)
1536 && !levl[x][y].seenv)
1537 return FALSE;
1538 u.tx = x;
1539 u.ty = y;
1540 ret = findtravelpath(TRAVP_VALID);
1541 u.tx = tx;
1542 u.ty = ty;
1543 return ret;
1544}
1545
1546/* try to escape being stuck in a trapped state by walking out of it;
1547 return true iff moving should continue to intended destination

Callers 1

auto_describeFunction · 0.85

Calls 4

glyph_atFunction · 0.85
isokFunction · 0.85
glyph_to_cmapFunction · 0.85
findtravelpathFunction · 0.85

Tested by

no test coverage detected