git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7648 c06c8d41-db1a-0410-9941-cceddc491573
4WYUT4KZ2Y77BNUGJSZIUGB2PCCKVSH7RKBXYLQJHPX5X2KW7WLQC
}
#endif
#ifdef WIZARD
// Try to find and use stairs already in the portal vault level,
// since this might be a multi-level portal vault like a ziggurat.
bool _take_portal_vault_stairs( const bool down )
{
ASSERT(you.level_type == LEVEL_PORTAL_VAULT);
const command_type cmd = down ? CMD_GO_DOWNSTAIRS : CMD_GO_UPSTAIRS;
coord_def stair_pos(-1, -1);
for (int x = 0; x < GXM; x++)
for (int y = 0; y < GYM; y++)
{
if (grid_stair_direction(grd[x][y]) == cmd)
{
stair_pos.set(x, y);
break;
}
}
if (!in_bounds(stair_pos))
return (false);
you.position = stair_pos;
if (down)
down_stairs(you.your_level);
else
up_stairs();
return (true);