diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-04-24 18:03:29 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-04-24 18:03:29 +0200 |
commit | 98830d744936d4f1b96106662ba787366a806f90 (patch) | |
tree | 10ea72784db951d194e3e5ad815fac8d83b1eeb1 /crawl-ref/source/place-info.cc | |
parent | fd3b6afd91dc0746a4e1801c4ffa06c092a1bf96 (diff) | |
download | crawl-ref-98830d744936d4f1b96106662ba787366a806f90.tar.gz crawl-ref-98830d744936d4f1b96106662ba787366a806f90.zip |
Fix Sprint crashing on references to non-existent branches.
Diffstat (limited to 'crawl-ref/source/place-info.cc')
-rw-r--r-- | crawl-ref/source/place-info.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/place-info.cc b/crawl-ref/source/place-info.cc index 3c871413d4..32af4ca69d 100644 --- a/crawl-ref/source/place-info.cc +++ b/crawl-ref/source/place-info.cc @@ -35,8 +35,11 @@ void PlaceInfo::assert_validity() const || num_visits > 0 && levels_seen > 0); if (branch >= 0) // global data is -1 - if (brdepth[branch] > 1 || is_connected_branch(branch)) + if (brdepth[branch] > 1 + || 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)); |