summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-17 17:38:36 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-17 17:38:36 +0000
commit23c5277317de657f8376d1b5f33144948a811a42 (patch)
treede39ce9e4c369e1f42ddf291695d25b1c5c44c55 /crawl-ref/source/tags.cc
parenta9a5ce7479fc6358f96aadad9654d35f2a573782 (diff)
downloadcrawl-ref-23c5277317de657f8376d1b5f33144948a811a42.tar.gz
crawl-ref-23c5277317de657f8376d1b5f33144948a811a42.zip
[1738010] Stash-tracker now also tracks traps and other dungeon features.
Changed env.grid to dungeon_feature_type. (The special-level builder still stores map characters directly into env.grid and then translates them to features.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1592 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index e492b338aa..dd192cb77e 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1520,8 +1520,10 @@ static void tag_read_level( struct tagHeader &th, char minorVersion )
{
for (j = 0; j < gy; j++)
{
- grd[i][j] = unmarshallByte(th);
-
+ grd[i][j] =
+ static_cast<dungeon_feature_type>(
+ static_cast<unsigned char>(unmarshallByte(th)) );
+
env.map[i][j].object = unmarshallShort(th);
env.map[i][j].colour = unmarshallShort(th);
env.map[i][j].flags = unmarshallShort(th);
@@ -1568,7 +1570,9 @@ static void tag_read_level_items(struct tagHeader &th, char minorVersion)
count = unmarshallShort(th);
for (i = 0; i < count; ++i)
{
- env.trap[i].type = unmarshallByte(th);
+ env.trap[i].type =
+ static_cast<trap_type>(
+ static_cast<unsigned char>(unmarshallByte(th)) );
env.trap[i].x = unmarshallByte(th);
env.trap[i].y = unmarshallByte(th);
}