summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-29 00:57:54 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-29 00:57:54 -0700
commite083e2c09aad37199affe880180f2eda90d213ac (patch)
treebfc040e0ca6789a5f15c95f67fb19a9ff9bb6a3f /crawl-ref/source/travel.cc
parenta94e957868e1fc5b62358573d39bc27b1d6d38ab (diff)
downloadcrawl-ref-e083e2c09aad37199affe880180f2eda90d213ac.tar.gz
crawl-ref-e083e2c09aad37199affe880180f2eda90d213ac.zip
level_pos: add methods current() and is_on()
Added to level_pos the static method current(), similar to level_id::current(), and is_on(level_id lev), which returns true if the level_pos is on the given level_id.
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r--crawl-ref/source/travel.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 079b4a877d..f7d1a5ab5b 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -2934,6 +2934,11 @@ void level_id::load(reader& inf)
level_type = static_cast<level_area_type>(unmarshallShort(inf));
}
+level_pos level_pos::current()
+{
+ return level_pos(level_id::current(), you.pos());
+}
+
// NOTE: see also marshall_level_pos
void level_pos::save(writer& outf) const
{