diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-20 23:13:43 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-20 23:13:43 +0000 |
commit | 71f875768429c444e6e066ef16ba35c27bd282a1 (patch) | |
tree | 1f6dd6e9bbcf57f5072dceacec630eac34a01323 /crawl-ref/source/travel.cc | |
parent | a5d66474e6c96474653975ce88b5ce08adefb5f7 (diff) | |
download | crawl-ref-71f875768429c444e6e066ef16ba35c27bd282a1.tar.gz crawl-ref-71f875768429c444e6e066ef16ba35c27bd282a1.zip |
Add a few minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6013 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r-- | crawl-ref/source/travel.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 7930c85352..b9ece90677 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -605,13 +605,7 @@ bool is_branch_stair(int gridx, int gridy) bool is_stair(dungeon_feature_type gridc) { - return (is_travelable_stair(gridc) - || gridc == DNGN_ENTER_ABYSS - || gridc == DNGN_EXIT_ABYSS - || gridc == DNGN_ENTER_LABYRINTH - || gridc == DNGN_ENTER_PANDEMONIUM - || gridc == DNGN_EXIT_PANDEMONIUM - || gridc == DNGN_TRANSIT_PANDEMONIUM); + return (is_travelable_stair(gridc) || is_gate(gridc)); } // Returns true if the given dungeon feature can be considered a stair. @@ -666,6 +660,23 @@ bool is_travelable_stair(dungeon_feature_type gridc) } } +// Returns true if the given dungeon feature can be considered a gate. +bool is_gate(dungeon_feature_type gridc) +{ + switch (gridc) + { + case DNGN_ENTER_ABYSS: + case DNGN_EXIT_ABYSS: + case DNGN_ENTER_LABYRINTH: + case DNGN_ENTER_PANDEMONIUM: + case DNGN_EXIT_PANDEMONIUM: + case DNGN_TRANSIT_PANDEMONIUM: + return true; + default: + return false; + } +} + // Prompts the user to stop explore if necessary for the given // explore-stop condition, returns true if explore should be stopped. bool prompt_stop_explore(int es_why) |