From a6fa467deec581b1f0c1392e2658c7072c1a994d Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 22 Jun 2008 01:22:34 +0000 Subject: Let a level_id be directly compared to a branch type with == and != to determine if a level_id is (not) in BRANCH_FOO; takes care of comparing level_type to LEVEL_DUNGEON. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6034 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/traps.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/traps.cc') diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index f2e2144a7a..e28d838b0b 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -1003,7 +1003,7 @@ bool is_valid_shaft_level(const level_id &place) return (false); // Disallow shafts on the first two levels. - if (place.branch == BRANCH_MAIN_DUNGEON + if (place == BRANCH_MAIN_DUNGEON && you.your_level < 2) { return (false); @@ -1196,8 +1196,7 @@ static trap_type random_trap_default(int level_number, const level_id &place) type = TRAP_BLADE; if (random2(1 + level_number) > 14 && one_chance_in(3) - || (place.branch == BRANCH_HALL_OF_ZOT - && place.level_type == LEVEL_DUNGEON && coinflip())) + || (place == BRANCH_HALL_OF_ZOT && coinflip())) { type = TRAP_ZOT; } -- cgit v1.2.3-54-g00ecf