summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-20 23:13:43 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-20 23:13:43 +0000
commit71f875768429c444e6e066ef16ba35c27bd282a1 (patch)
tree1f6dd6e9bbcf57f5072dceacec630eac34a01323 /crawl-ref
parenta5d66474e6c96474653975ce88b5ce08adefb5f7 (diff)
downloadcrawl-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')
-rw-r--r--crawl-ref/source/religion.cc6
-rw-r--r--crawl-ref/source/travel.cc25
-rw-r--r--crawl-ref/source/travel.h1
3 files changed, 21 insertions, 11 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index e75112dc9d..fc33282b75 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1684,10 +1684,8 @@ blessing_done:
whom = "a follower";
}
- snprintf(info, INFO_SIZE, " blesses %s with %s.",
- whom.c_str(), result.c_str());
-
- simple_god_message(info, god);
+ simple_god_message(make_stringf(" blesses %s with %s.",
+ whom.c_str(), result.c_str()).c_str(), god);
#ifndef USE_TILE
if (see_follower)
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)
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 8fcf639a73..d657cbb21a 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -72,6 +72,7 @@ void update_excludes();
bool is_exclude_root(const coord_def &p);
bool is_stair(dungeon_feature_type gridc);
bool is_travelable_stair(dungeon_feature_type gridc);
+bool is_gate(dungeon_feature_type gridc);
command_type direction_to_command( char x, char y );
bool is_resting( void );
#ifdef CLUA_BINDINGS