Repository navigation
More level generation bug fixes - #394
Closed
copperwater wants to merge 4 commits into
Closed
copperwater wants to merge 4 commits into
copperwater wants to merge 4 commits into
Conversation
This is a simple && vs || bug. The clear intention of the code is that stairs aren't supposed to generate in themed rooms unless there is no other choice. Fixes NetHack#348
This was leading to problems with special themed rooms which were irregular. Walls of ordinary rooms count as part of the room, and irregular rooms should be no different. This also makes doors on the room edge be considered as part of the room, which affected special room entry messages and filling. All irregular rooms' walls getting marked as SHARED instead of their own room is probably a latent bug in upstream NetHack, but will prevent future issues for when/if themed rooms that involve special rooms/subrooms get added.
This also caused the unexpected "You hear someone searching" message on a level with an unlooted vault.
Consider the following scenario: There's a level where there's a zone of des.replace_terrain() between the stairs and some other objective, and the terrain is something non-walkable like trees. There's a chance that the path is entirely blocked off by random replace_terrain, so you make the level set terrain to '.' along a randline (or normal line, or whatever) between the randomly placed stairs and the other side of the replace_terrain zone. The problem: this overwrote the stairs with a '.' as well. This can be worked around in the lua file by first picking the desired location of the stairs, then setting the terrain that overlaps with the stairs, then doing des.stair() after that, but this is awkward and hard to read. So this makes it impossible for anything calling SET_TYPLIT (only called in sp_lev.c) to overwrite stairs. I can't really think of a situation where a level designer would want to define stairs, then maybe overwrite them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains a couple more fixes for bugs discovered later in xNetHack after the Lua changes in #347 were merged into it, plus a couple fixes for latent level generation bugs.