]> granicus.if.org Git - nethack/commit
Make replace_terrain respect fromterrain='w'
authorcopperwater <aosdict@gmail.com>
Sun, 4 Sep 2022 16:31:45 +0000 (12:31 -0400)
committerPatR <rankin@nethack.org>
Fri, 23 Sep 2022 06:55:45 +0000 (23:55 -0700)
commit9118ec82628ecd8072137d093dafabcfe851c020
tree543b7def7af20df71c96c57bbaba10b4e53c5e7d
parenteaac5b6c745255b998c91e2955581d537e933d58
Make replace_terrain respect fromterrain='w'

Noticed that an attempted terrain replacement wasn't taking hold even
though 'w' is supposed to mean "match any stone or wall"; this was
because w converts into non-terrain-type MATCH_WALL and replace_terrain
was doing a simple comparison on whether the potentially replaced
terrain matches that type. Add a special check here for w so it will
match the terrain types it's supposed to.

Note that using replace_terrain with 'w' now WILL match stone, since
this is the documented behavior of w, to match IS_STWALL rather than
just IS_WALL. If a level designer really wants to exclude stone, they
can work around this by either making a selection and filter out stone
terrain, or doing two replace_terrains with '-' and '|'.
src/sp_lev.c