restore autodig behavior
autodig messages were broken due to a change in the dig_typ interface which shifted all the values by 1, but not all callers of dig_typ got changed.
This commit is contained in:
@@ -140,7 +140,8 @@ xchar x, y;
|
|||||||
return (ispick && sobj_at(STATUE, x, y) ? DIGTYP_STATUE :
|
return (ispick && sobj_at(STATUE, x, y) ? DIGTYP_STATUE :
|
||||||
ispick && sobj_at(BOULDER, x, y) ? DIGTYP_BOULDER :
|
ispick && sobj_at(BOULDER, x, y) ? DIGTYP_BOULDER :
|
||||||
closed_door(x, y) ? DIGTYP_DOOR :
|
closed_door(x, y) ? DIGTYP_DOOR :
|
||||||
IS_TREE(levl[x][y].typ) ? (ispick ? DIGTYP_UNDIGGABLE : DIGTYP_TREE) :
|
IS_TREE(levl[x][y].typ) ?
|
||||||
|
(ispick ? DIGTYP_UNDIGGABLE : DIGTYP_TREE) :
|
||||||
ispick && IS_ROCK(levl[x][y].typ) &&
|
ispick && IS_ROCK(levl[x][y].typ) &&
|
||||||
(!level.flags.arboreal || IS_WALL(levl[x][y].typ)) ?
|
(!level.flags.arboreal || IS_WALL(levl[x][y].typ)) ?
|
||||||
DIGTYP_ROCK : DIGTYP_UNDIGGABLE);
|
DIGTYP_ROCK : DIGTYP_UNDIGGABLE);
|
||||||
@@ -408,18 +409,18 @@ cleanup:
|
|||||||
return(0);
|
return(0);
|
||||||
} else { /* not enough effort has been spent yet */
|
} else { /* not enough effort has been spent yet */
|
||||||
static const char *d_target[6] = {
|
static const char *d_target[6] = {
|
||||||
"", "rock", "statue", "boulder", "door", "tree"
|
"", "rock", "statue", "boulder", "door", "tree"
|
||||||
};
|
};
|
||||||
int dig_target = dig_typ(uwep, dpx, dpy);
|
int dig_target = dig_typ(uwep, dpx, dpy);
|
||||||
|
|
||||||
if (IS_WALL(lev->typ) || dig_target == 3) {
|
if (IS_WALL(lev->typ) || dig_target == DIGTYP_DOOR) {
|
||||||
if(*in_rooms(dpx, dpy, SHOPBASE)) {
|
if(*in_rooms(dpx, dpy, SHOPBASE)) {
|
||||||
pline("This %s seems too hard to %s.",
|
pline("This %s seems too hard to %s.",
|
||||||
IS_DOOR(lev->typ) ? "door" : "wall", verb);
|
IS_DOOR(lev->typ) ? "door" : "wall", verb);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
} else if (!IS_ROCK(lev->typ) && !dig_target)
|
} else if (!IS_ROCK(lev->typ) && dig_target == DIGTYP_ROCK)
|
||||||
return(0); /* statue or boulder got taken */
|
return(0); /* statue or boulder got taken */
|
||||||
if(!did_dig_msg) {
|
if(!did_dig_msg) {
|
||||||
You("hit the %s with all your might.",
|
You("hit the %s with all your might.",
|
||||||
d_target[dig_target]);
|
d_target[dig_target]);
|
||||||
@@ -749,7 +750,6 @@ dig_up_grave()
|
|||||||
{
|
{
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
|
||||||
|
|
||||||
/* Grave-robbing is frowned upon... */
|
/* Grave-robbing is frowned upon... */
|
||||||
exercise(A_WIS, FALSE);
|
exercise(A_WIS, FALSE);
|
||||||
if (Role_if(PM_ARCHEOLOGIST)) {
|
if (Role_if(PM_ARCHEOLOGIST)) {
|
||||||
@@ -827,7 +827,8 @@ struct obj *obj;
|
|||||||
ry = u.uy + u.dy;
|
ry = u.uy + u.dy;
|
||||||
/* Include down even with axe, so we have at least one direction */
|
/* Include down even with axe, so we have at least one direction */
|
||||||
if (u.dz > 0 ||
|
if (u.dz > 0 ||
|
||||||
(u.dz == 0 && isok(rx, ry) && dig_typ(obj, rx, ry)))
|
(u.dz == 0 && isok(rx, ry) &&
|
||||||
|
dig_typ(obj, rx, ry) != DIGTYP_UNDIGGABLE))
|
||||||
*dsp++ = *sdp;
|
*dsp++ = *sdp;
|
||||||
sdp++;
|
sdp++;
|
||||||
}
|
}
|
||||||
@@ -934,7 +935,8 @@ struct obj *obj;
|
|||||||
digging.quiet = FALSE;
|
digging.quiet = FALSE;
|
||||||
if (digging.pos.x != rx || digging.pos.y != ry ||
|
if (digging.pos.x != rx || digging.pos.y != ry ||
|
||||||
!on_level(&digging.level, &u.uz) || digging.down) {
|
!on_level(&digging.level, &u.uz) || digging.down) {
|
||||||
if (flags.autodig && !dig_target && !digging.down &&
|
if (flags.autodig &&
|
||||||
|
dig_target == DIGTYP_ROCK && !digging.down &&
|
||||||
digging.pos.x == u.ux &&
|
digging.pos.x == u.ux &&
|
||||||
digging.pos.y == u.uy &&
|
digging.pos.y == u.uy &&
|
||||||
(moves <= digging.lastdigtime+2 &&
|
(moves <= digging.lastdigtime+2 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user