]> granicus.if.org Git - nethack/commitdiff
special level alignments
authorcohrs <cohrs>
Sun, 7 Jul 2002 07:18:05 +0000 (07:18 +0000)
committercohrs <cohrs>
Sun, 7 Jul 2002 07:18:05 +0000 (07:18 +0000)
From the newsgroup a while back - special levels w/o a specific alignment
should inherit their alignment from the dungeon.  Some places explicitly
checked the dungeon if the level alignment wasn't set, at least one did not.

doc/fixes34.1
src/dungeon.c

index ec205168388c03c078cadaee479f43873ddc901b..0e0479e5731e15863038d6574d66340cec2823b7 100644 (file)
@@ -146,6 +146,7 @@ no messages were printed when dowaterdemon or dowaternymph failed to create
        a monster doe to the G_GONE check
 knights should be able to avenge attacks from covetous monsters
 eating various rotten food items would not break vegan/vegetarian conduct
+unaligned special levels should inherit alignment from the dungeon
 
 
 Platform- and/or Interface-Specific Fixes
index 6e7b448b5d0b89a8416556f924eb1666987519dc..815d1dbb9c1ffa695fdc1a2c05a34caf879c9ed9 100644 (file)
@@ -486,6 +486,9 @@ init_level(dgn, proto_index, pd)
        new_level->flags.maze_like = !!(tlevel->flags & MAZELIKE);
        new_level->flags.rogue_like = !!(tlevel->flags & ROGUELIKE);
        new_level->flags.align = ((tlevel->flags & D_ALIGN_MASK) >> 4);
+       if (!new_level->flags.align) 
+           new_level->flags.align =
+               ((pd->tmpdungeon[dgn].flags & D_ALIGN_MASK) >> 4);
 
        new_level->rndlevs = tlevel->rndlevs;
        new_level->next    = (s_level *) 0;