Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
7061 Bug Report minor always 2013-05-20 04:20 2015-03-26 05:32
elliptic Local  
Reaver Linux  
normal Console  
resolved 0.13 ancient branch  
done  
none    
none 0.17 ancient branch  
0007061: Duplicate and inconsistent code for stair/shop traversal
Was originally "Trying to use stairs in tree-form costs a turn.", but the bug goes deeper than that. See comments
parent of 0007074closed neil attempting to use stairs in tree form consumes a turn 
parent of 0007073closed neil tree form prevents banishment 
has duplicate 0009447resolved wheals Falling down a shaft while confused prints an erroneous message. 
? file icon 0001-Clean-up-stairs-commands-and-checks.patch [^] (17,200 bytes) 2013-05-23 07:59 [Show Content]
? file icon 0002-Merge-up_stairs-and-down_stairs-into-take_stairs.patch [^] (38,946 bytes) 2015-01-27 04:54 [Show Content]
Issue History
2013-05-20 04:20 elliptic New Issue
2013-05-20 05:05 Medar Issue Monitored: Medar
2013-05-20 15:28 neil Note Added: 0022711
2013-05-20 15:28 neil Status new => confirmed
2013-05-21 00:33 neil Note Added: 0022717
2013-05-21 00:35 neil Summary Trying to use stairs in tree-form costs a turn. => Duplicate and inconsistent code for stair/shop traversal
2013-05-21 00:35 neil Description Updated
2013-05-21 00:39 neil Status confirmed => assigned
2013-05-21 00:39 neil Assigned To => neil
2013-05-21 00:40 neil Note Added: 0022718
2013-05-23 07:59 Zannick File Added: 0001-Clean-up-stairs-commands-and-checks.patch
2013-05-23 08:07 Zannick Note Added: 0022788
2013-05-23 10:02 mumra Relationship added parent of 0007074
2013-05-24 18:56 neil Relationship added parent of 0007073
2013-05-24 19:36 neil Note Added: 0022802
2013-06-01 06:06 neil Note Added: 0022997
2013-06-10 02:57 neil Issue Monitored: neil
2013-06-10 02:57 neil Issue End Monitor: neil
2014-06-06 21:25 neil Assigned To neil =>
2014-06-06 21:25 neil Status assigned => confirmed
2015-01-27 04:54 Zannick File Added: 0002-Merge-up_stairs-and-down_stairs-into-take_stairs.patch
2015-01-27 04:56 Zannick Note Added: 0028365
2015-01-28 16:22 wheals Relationship added has duplicate 0009447
2015-03-26 05:32 Reaver Note Added: 0028714
2015-03-26 05:32 Reaver Status confirmed => resolved
2015-03-26 05:32 Reaver Fixed in Branch => 0.17 development branch
2015-03-26 05:32 Reaver Resolution open => done
2015-03-26 05:32 Reaver Assigned To => Reaver

Notes
(0022711)
neil   
2013-05-20 15:28   
Tree form should be handled in _go_upstairs() and _go_downstairs(); otherwise it will call start_delay() and you won't find out it's impossible until later.

There are various other inconsistencies: it is possible to enter a shop while netted with > but not with < (but in the latter case the message still refers to "using stairs"). It's not clear to me how tree form and netting should interact with shops: I would think it should be disallowed, but players seem to think that would be a pointless restriction.
(0022717)
neil   
2013-05-21 00:33   
_go_downstairs and _go_upstairs should be merged I think.

Also, there is a lot of duplication of checks between _go_downstairs() and down_stairs() (and likewise for up). The former handles the player command, while the latter handles the end of a delay; some checks are needed both places, for example if you are turned into a tree while in the process of climbing. Probably those checks should therefore be split into a separate function.
(0022718)
neil   
2013-05-21 00:40   
Zannick is working on this, assigned to me since he doesn't have the right account bits.
(0022788)
Zannick   
2013-05-23 08:07   
up_stairs() and down_stairs() have a lot of stuff in them that will take me a bit longer to work my way through in merging them, so I figured I'd wrap up my other changes (which resolve the treeform bugs reported here and in 0007073, 0007074) into a workable commit and post that before continuing.

I also axed a handful of the checks in up_stairs and down_stairs since they're unlikely to ever go off: moving the player interrupts any delayed stair travel, so we shouldn't need to double-check whether there's a stair we can take, unless some magic effect is forcing us (a la banish) to take an invalid staircase. Entering a shop has no delay, and no effect forces the player into a shop (shop() relies on the player's position anyway). And the "down stairs in Vestibule" check couldn't be fulfilled, as it wanted (stair_find > 65 && stair_find <= 45)
(0022802)
neil   
2013-05-24 19:36   
Applied in trunk (0.13-a0-897-gfcd48b8), thanks! I added one more commit (0.13-a0-898-g32ea864) that changes the held message to be less specific (because we don't yet know at that point in the code whether we're trying to take stairs or use a shop).
(0022997)
neil   
2013-06-01 06:06   
Also applied in stable (0.12.1-54-gd6fb6a2). Not closing because there is still some duplication that should be refactored in 0.13, but the bugs seem to be fixed now.
(0028365)
Zannick   
2015-01-27 04:56   
Sorry for the delay. =)
Here is a commit merging up_stairs and down_stairs, which shouldn't be a large behavior change except for a couple of minor bugs I spotted, like tripping on the way down a shaft.
(0028714)
Reaver   
2015-03-26 05:32   
Patch pushed as of 0.17-a0-185-gba09013, thanks!