This adds in <Someone>'s autodig patch.
This commit is contained in:
19
src/dig.c
19
src/dig.c
@@ -773,9 +773,8 @@ struct obj *obj;
|
||||
char dirsyms[12];
|
||||
char qbuf[QBUFSZ];
|
||||
register char *dsp = dirsyms;
|
||||
register struct rm *lev;
|
||||
register int rx, ry;
|
||||
int dig_target, res = 0;
|
||||
int res = 0;
|
||||
register const char *sdp;
|
||||
if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
|
||||
|
||||
@@ -804,6 +803,22 @@ struct obj *obj;
|
||||
Sprintf(qbuf, "In what direction do you want to dig? [%s]", dirsyms);
|
||||
if(!getdir(qbuf))
|
||||
return(res);
|
||||
|
||||
return(use_pick_axe2(obj));
|
||||
}
|
||||
|
||||
/* MRKR: use_pick_axe() is split in two to allow autodig to bypass */
|
||||
/* the "In what direction do you want to dig?" query. */
|
||||
/* use_pick_axe2() uses the existing u.dx, u.dy and u.dz */
|
||||
|
||||
int
|
||||
use_pick_axe2(obj)
|
||||
struct obj *obj;
|
||||
{
|
||||
register int rx, ry;
|
||||
register struct rm *lev;
|
||||
int dig_target;
|
||||
|
||||
if (u.uswallow && attack(u.ustuck)) {
|
||||
; /* return(1) */
|
||||
} else if (Underwater) {
|
||||
|
||||
@@ -545,6 +545,14 @@ boolean test_only;
|
||||
} else if (tunnels(youmonst.data) && !needspick(youmonst.data)) {
|
||||
/* Eat the rock. */
|
||||
if (!test_only && still_chewing(x,y)) return FALSE;
|
||||
} else if (flags.autodig && !flags.run && !flags.nopick && (uwep->otyp == PICK_AXE || uwep->otyp == DWARVISH_MATTOCK)) {
|
||||
/* MRKR: Automatic digging when wielding the appropriate tool */
|
||||
if (!test_only) {
|
||||
use_pick_axe2(uwep);
|
||||
flags.move = 0;
|
||||
nomul(0);
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
if ( !test_only ) {
|
||||
if (Is_stronghold(&u.uz) && is_db_wall(x,y))
|
||||
|
||||
@@ -39,6 +39,7 @@ static struct Bool_Opt
|
||||
#else
|
||||
{"asksavedisk", (boolean *)0, FALSE},
|
||||
#endif
|
||||
{"autodig", &flags.autodig, FALSE},
|
||||
{"autopickup", &flags.pickup, TRUE},
|
||||
{"autoquiver", &flags.autoquiver, FALSE},
|
||||
#if defined(MICRO) && !defined(AMIGA)
|
||||
|
||||
Reference in New Issue
Block a user