From 54945881c3da9d5610da4e29a62c2ab0c788d60b Mon Sep 17 00:00:00 2001 From: pauldubois Date: Mon, 17 Mar 2008 11:40:33 +0000 Subject: 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 --- crawl-ref/source/acr.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crawl-ref/source/acr.cc') 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