Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 3, 2012, 23:27   #1
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 344
bron is on a distinguished road
*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.
bron is offline   Reply With Quote
Old February 4, 2012, 00:37   #2
ekolis
Knight
 
ekolis's Avatar
 
Join Date: Apr 2007
Location: Cincinnati, OH, USA
Age: 30
Posts: 902
ekolis is on a distinguished road
Send a message via AIM to ekolis Send a message via MSN to ekolis Send a message via Yahoo to ekolis Send a message via Skype™ to ekolis
Quote:
Originally Posted by bron View Post
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.
__________________
You read the scroll labeled NOBIMUS UPSCOTI...
You are surrounded by a stasis field!
The tengu tries to teleport, but fails!

Last edited by ekolis; February 4, 2012 at 00:38. Reason: broken quote tags :(
ekolis is offline   Reply With Quote
Old February 4, 2012, 10:07   #3
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 4,983
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Many thanks for the fix. I've opened this as #1616, so it should be fixed for 3.4
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old February 4, 2012, 17:50   #4
LostTemplar
Knight
 
Join Date: Aug 2009
Posts: 648
LostTemplar is on a distinguished road
Btw in FAangband destrucion does not affect stairs.
LostTemplar is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
*Destruction* deletes stairs bron Vanilla 7 August 27, 2011 04:44
Connected stairs - something to consider Antoine Development 17 May 14, 2011 08:51
Rods of detect traps and stairs/doors Timo Pietilš Development 13 March 10, 2011 04:38
Playing with 'restricted' stairs fizzix AAR 0 July 20, 2010 00:12
[O] Levels are generated with no stairs at all Therem Harth Variants 3 June 28, 2010 23:08


All times are GMT +1. The time now is 12:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.