summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-17 11:40:33 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-17 11:40:33 +0000
commit54945881c3da9d5610da4e29a62c2ab0c788d60b (patch)
tree7b0d0c29113834437a2d0a96cf73aa65a8b27824 /crawl-ref/source/acr.cc
parenteda11ccd07fd9869b193d33490d456a56649b4de (diff)
downloadcrawl-ref-54945881c3da9d5610da4e29a62c2ab0c788d60b.tar.gz
crawl-ref-54945881c3da9d5610da4e29a62c2ab0c788d60b.zip
More fixes so 1916515 doesn't happen again.
Add BRANCH_FIRST_HELL and BRANCH_LAST_HELL and check vs those in player_in_hell() rather than hard-coding the enums. Whoever did that is naughty; they should have at least stuck a comment in the branch enum. Also added some compile-checks in player_in_hell to draw attention in case the hell branches are touched. Also added some startup code that verifies the branches[] array (whose name should be changed to Branches!) is in the same order as the branches enum. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3690 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index a681d16089..39657a0e58 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -4399,4 +4399,11 @@ void compile_time_asserts()
//jmf: NEW ASSERTS: we ought to do a *lot* of these
COMPILE_CHECK(NUM_SPELLS < SPELL_NO_SPELL , c7);
COMPILE_CHECK(NUM_JOBS < JOB_UNKNOWN , c8);
+
+ // Also some runtime stuff; I don't know if the order of branches[]
+ // needs to match the enum, but it currently does.
+ for (int i=0; i<NUM_BRANCHES; i++)
+ {
+ ASSERT(branches[i].id == i);
+ }
}