]> granicus.if.org Git - nethack/commit
fix #H3033 - Crash upon teleport onto a sink while equipping levitation boots
authornethack.rankin <nethack.rankin>
Sat, 26 Oct 2013 21:33:47 +0000 (21:33 +0000)
committernethack.rankin <nethack.rankin>
Sat, 26 Oct 2013 21:33:47 +0000 (21:33 +0000)
commitd7a467fff1e4a141aae3655401119928ec9adcd4
tree98ee79c9d6ebe7625841138bf6783c62e7087436
parentc9fc8fcc0988fccecc1f9ea08c6e26832e469f34
fix #H3033 - Crash upon teleport onto a sink while equipping levitation boots

     From a bug report, being teleported onto
a sink while busy putting on levitation boots triggered a crash when
Boots_on() was called (as '(*aftermv)()' on the next turn) because
'uarmf' would be null by then.  Not mentioned, but the same problem was
encountered by Boots_off() if the teleport happened while you were busy
taking boots off.  It could be fixed by having having dosinkfall() call
cancel_don() if donning(uarmf) yields true, but this patch does a little
more than that:  cancel donning/doffing of any multi-turn armor if you
fall onto a sink.  It also prevents you from falling if you end up
flying (which will have been blocked while levitating).

     The situation when putting on levitation boots has a sequencing
issue:  setworn() causes you to be flagged as levitating immediately,
but the float_up() feedback doesn't occur until Boots_on() gets called
a turn later.  Teleporting to the sink will tell you that you crash
onto the sink and and that you stop putting on boots, without having
been told that you've floated up into the air.  It's suboptimal but it
doesn't seem to actually be incorrect.
doc/fixes35.0
src/hack.c