summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-09 09:11:41 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-09 09:11:41 +0000
commit8c1ca155f86b9828efa8b10d703c2fd523d1e0d9 (patch)
treee04bc9f0fa9b7bde98412f7afbb5de895caa4830 /crawl-ref/source/travel.h
parent19c9624157d17b27641120d0e5aac81d67168c55 (diff)
downloadcrawl-ref-8c1ca155f86b9828efa8b10d703c2fd523d1e0d9.tar.gz
crawl-ref-8c1ca155f86b9828efa8b10d703c2fd523d1e0d9.zip
Interlevel travel now handles branch stairs more intelligently:
Travel knows that all branch exits of the same type share the same destination, and will use the nearest branch exit, even if you've never used it before. The same applies to multiple branch entries, the portals to Zot:1 for instance. This does mean that the first visit to Zot is likely to generate a bad Zot-exit guess (Zot has many entries and many exits), but that'll be fixed the first time the player leaves Zot. .tc version updated. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@945 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r--crawl-ref/source/travel.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 97491884c1..e0e24d790f 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -260,18 +260,17 @@ private:
struct stair_info
{
coord_def position; // Position of stair
-
+ int grid; // Grid feature of the stair.
level_pos destination; // The level and the position on the level this
// stair leads to. This may be a guess.
-
int distance; // The distance traveled to reach this stair.
-
bool guessed_pos; // true if we're not sure that 'destination' is
// correct.
- stair_info() : destination(), distance(-1), guessed_pos(true)
+ stair_info()
+ : position(-1, -1), grid(DNGN_FLOOR), destination(),
+ distance(-1), guessed_pos(true)
{
- position.x = position.y = -1;
}
void reset_distance()
@@ -341,6 +340,8 @@ private:
void correct_stair_list(const std::vector<coord_def> &s);
void update_stair_distances();
+ void sync_all_branch_stairs();
+ void sync_branch_stairs(const stair_info *si);
void fixup();
private: