From 86bae0c1a3a28bc81c0fb66576e63c0a965c292c Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 29 Mar 2008 00:54:15 +0000 Subject: Prevent shafts from being created in corridors, at least until around dungeon level 7. Rename ROCK_STAIRS to ESCAPE_HATCH, as well as the corresponding function, since I think that the escape hatches are such a cool concept that we won't be going back, and the current coding name is a bit confusing. Clean up dungeon.cc. I'll probably have to add stuff into our new conventions file as I've been making up a lot of new rules in trying to make the code more readable. (Rules concerning nested brackets, and function indentation, etc.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3927 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/terrain.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/terrain.cc') diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index fbd031907a..cb008c08fd 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -54,16 +54,9 @@ bool grid_is_stone_stair(dungeon_feature_type grid) } } -bool grid_is_rock_stair(dungeon_feature_type grid) +bool grid_is_escape_hatch(dungeon_feature_type grid) { - switch (grid) - { - case DNGN_ROCK_STAIRS_UP: - case DNGN_ROCK_STAIRS_DOWN: - return (true); - default: - return (false); - } + return (grid == DNGN_ESCAPE_HATCH_UP || grid == DNGN_ESCAPE_HATCH_DOWN); } bool grid_sealable_portal(dungeon_feature_type grid) @@ -93,7 +86,7 @@ command_type grid_stair_direction(dungeon_feature_type grid) case DNGN_STONE_STAIRS_UP_I: case DNGN_STONE_STAIRS_UP_II: case DNGN_STONE_STAIRS_UP_III: - case DNGN_ROCK_STAIRS_UP: + case DNGN_ESCAPE_HATCH_UP: case DNGN_RETURN_FROM_ORCISH_MINES: case DNGN_RETURN_FROM_HIVE: case DNGN_RETURN_FROM_LAIR: @@ -122,7 +115,7 @@ command_type grid_stair_direction(dungeon_feature_type grid) case DNGN_STONE_STAIRS_DOWN_I: case DNGN_STONE_STAIRS_DOWN_II: case DNGN_STONE_STAIRS_DOWN_III: - case DNGN_ROCK_STAIRS_DOWN: + case DNGN_ESCAPE_HATCH_DOWN: case DNGN_ENTER_DIS: case DNGN_ENTER_GEHENNA: case DNGN_ENTER_COCYTUS: @@ -193,7 +186,7 @@ bool grid_is_permarock(dungeon_feature_type grid) bool grid_is_trap(dungeon_feature_type grid) { return (grid == DNGN_TRAP_MECHANICAL || grid == DNGN_TRAP_MAGICAL - || grid == DNGN_TRAP_NATURAL); + || grid == DNGN_TRAP_NATURAL); } bool grid_is_water( dungeon_feature_type grid ) -- cgit v1.2.3-54-g00ecf