autodig '>'

This fixes moving in direction '>' while wielding a pick-axe with
the 'autodig' option On.  Attempting to dig assumed size-to-side
activity because u.dz wasn't being set, so the pick-axe was swung at
thin air instead making a pit or turning an existing pit into a hole.

dodown() and doup() should probably call set_move_cmd() instead of
manipulating u.dz directly.  But they would also need to suppress
g.move_attempting or the game says "you can't get there from here..."
after successfully digging or plunging into a pit.
This commit is contained in:
PatR
2022-01-21 14:27:21 -08:00
parent afc2e1592d
commit 75fed4b92b
2 changed files with 3 additions and 0 deletions

View File

@@ -1070,6 +1070,7 @@ dodown(void)
} else if (!trap || !is_hole(trap->ttyp)
|| !Can_fall_thru(&u.uz) || !trap->tseen) {
if (flags.autodig && !g.context.nopick && uwep && is_pick(uwep)) {
u.dz = 1; /* the #down command doesn't call set_move_cmd() */
return use_pick_axe2(uwep);
} else {
You_cant("go down here.");