summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/place.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/place.cc')
-rw-r--r--crawl-ref/source/place.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc
index 67de365065..7e469b4b28 100644
--- a/crawl-ref/source/place.cc
+++ b/crawl-ref/source/place.cc
@@ -37,6 +37,13 @@ int place_depth(unsigned short place)
return lev == 0xFF? -1 : lev;
}
+int place_type(unsigned short place)
+{
+ const unsigned type = (unsigned) ((place >> 8) & 0xFF);
+ const int lev = place & 0xFF;
+ return lev == 0xFF? (int) type : (int) LEVEL_DUNGEON;
+}
+
unsigned short get_packed_place( branch_type branch, int subdepth,
level_area_type level_type )
{