*Destruction* deletes stairs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bron
    Knight
    • May 2008
    • 515

    *Destruction* deletes stairs

    Several months ago I ran across an ugly feature: reading a *destruction* scroll will delete most things; unfortunately for me "most things" includes stairs. Doubly unfortunate for me, I discovered this on level 99 of an ironman game after killing Sauron, which made it kinda hard to go down to level 100 (see http://angband.oook.cz/forum/showthread.php?t=4839 if you care).

    At the time, I promised to write some code to fix the problem, but of course, I never did. I have now (finally) looked into the problem. My original proposal was to add some chrome to convert the stairs into rubble, and then back to stairs once they were dug out. This looks to be a lot harder than I gave it credit for. The FEAT_* definitions in defines.h do not have any gaps in them where something could be slipped in, and the source code has at least a couple of instances of constructs like: "if (cave_feat[y][x] >= FEAT_WALL_EXTRA)" which makes adding new entries at the end somewhat problematic.

    So I now propose using the simple fix of changing destroy_area in spells2.c to just skip over stairs. And in the course of investigating this, I now see where the bug slipped in: right now, destroy_area checks to see if it should skip a space by using the test "cave_isperm", whereas is older sources, this test was done using "cave_valid_bold". I am fairly certain that this was changed in order to make *destruct* effective at destroying artifacts, so that people could not use the hack of *destructing* a vault and then picking through the remains. But it has the unfortunate and probably unexpected side effect of also allowing the destruction of stairs.

    The fix appears to be simple: in spells2.c:destroy_area, instead of
    if (!cave_isperm(cave, y, x))
    just instead use
    if (!cave_perma_bold(x,y))
    which will skip over stairs as well as permanent walls, but not artifacts.
  • ekolis
    Knight
    • Apr 2007
    • 921

    #2
    Originally posted by bron
    if (!cave_isperm(cave, y, x))
    Totally off topic, but that is an AWESOME function name...

    There's more to life than just creating. There's PROcreating. And for men who are unable to do so naturally, we have the Apple iSperm.
    Last edited by ekolis; February 4, 2012, 01:38. Reason: broken quote tags :(
    You read the scroll labeled NOBIMUS UPSCOTI...
    You are surrounded by a stasis field!
    The tengu tries to teleport, but fails!

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Many thanks for the fix. I've opened this as #1616, so it should be fixed for 3.4
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • LostTemplar
        Knight
        • Aug 2009
        • 670

        #4
        Btw in FAangband destrucion does not affect stairs.

        Comment

        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎