diff options
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r-- | crawl-ref/source/travel.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 297d953cfe..539fe436c8 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -2853,6 +2853,15 @@ stair_info *LevelInfo::get_stair(int x, int y) return get_stair(c); } +bool LevelInfo::know_stair(const coord_def &c) const +{ + const int index = get_stair_index(c); + if (index == -1) + return (false); + const level_pos &lp = stairs[index].destination; + return (lp.is_valid()); +} + stair_info *LevelInfo::get_stair(const coord_def &pos) { int index = get_stair_index(pos); @@ -3067,6 +3076,12 @@ void LevelInfo::fixup() } } +bool TravelCache::know_stair(const coord_def &c) const +{ + travel_levels_map::const_iterator i = levels.find(level_id::current()); + return (i == levels.end()? false : i->second.know_stair(c)); +} + void TravelCache::travel_to_waypoint(int num) { if (num < 0 || num >= TRAVEL_WAYPOINT_COUNT) return; |