summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/place-info.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-10-26 16:44:21 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-11-04 18:49:50 +0100
commitacbc1dae1491c9d986fd81acb70a91ba8785bf4d (patch)
tree7c05c37668f14a4c3bb624fa7c6b511dbbcab1c0 /crawl-ref/source/place-info.cc
parentff3b896cb6e3770cd593b867405fde9a94bba00b (diff)
downloadcrawl-ref-acbc1dae1491c9d986fd81acb70a91ba8785bf4d.tar.gz
crawl-ref-acbc1dae1491c9d986fd81acb70a91ba8785bf4d.zip
Split the branch data into read-only and mutable parts.
As a side effect, branches can now be shortened without breaking major save compat. This commit itself doesn't preserve compat though, even though it'd be easy -- other parts are too nasty already.
Diffstat (limited to 'crawl-ref/source/place-info.cc')
-rw-r--r--crawl-ref/source/place-info.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/place-info.cc b/crawl-ref/source/place-info.cc
index 71abab9093..efb08c2138 100644
--- a/crawl-ref/source/place-info.cc
+++ b/crawl-ref/source/place-info.cc
@@ -34,8 +34,9 @@ void PlaceInfo::assert_validity() const
ASSERT(num_visits == 0 && levels_seen == 0
|| num_visits > 0 && levels_seen > 0);
- if (branches[branch].depth > 1 || is_connected_branch(branch))
- ASSERT((int)levels_seen <= branches[branch].depth);
+ if (branch >= 0) // global data is -1
+ if (brdepth[branch] > 1 || is_connected_branch(branch))
+ ASSERT((int)levels_seen <= brdepth[branch]);
ASSERT(turns_total == (turns_explore + turns_travel + turns_interlevel
+ turns_resting + turns_other));