summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 121077393a..cfb2b9bfec 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1940,6 +1940,19 @@ std::string short_place_name(level_id id)
return id.describe();
}
+int place_branch(unsigned short place)
+{
+ const unsigned branch = (unsigned) ((place >> 8) & 0xFF);
+ const int lev = place & 0xFF;
+ return lev == 0xFF? -1 : branch;
+}
+
+int place_depth(unsigned short place)
+{
+ const int lev = place & 0xFF;
+ return lev == 0xFF? -1 : lev;
+}
+
unsigned short get_packed_place( unsigned char branch, int subdepth,
char level_type )
{