Add Auto open doors -patch
This commit is contained in:
13
src/lock.c
13
src/lock.c
@@ -523,6 +523,14 @@ doforce() /* try to force a chest with your weapon */
|
||||
int
|
||||
doopen() /* try to open a door */
|
||||
{
|
||||
return doopen_indir(0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
doopen_indir(x, y) /* try to open a door in direction u.dx/u.dy */
|
||||
int x, y;
|
||||
{
|
||||
|
||||
coord cc;
|
||||
register struct rm *door;
|
||||
struct monst *mtmp;
|
||||
@@ -539,7 +547,10 @@ doopen() /* try to open a door */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!get_adjacent_loc((char *)0, (char *)0, u.ux, u.uy, &cc)) return(0);
|
||||
if (x > 0 && y > 0) {
|
||||
cc.x = x;
|
||||
cc.y = y;
|
||||
} else if(!get_adjacent_loc((char *)0, (char *)0, u.ux, u.uy, &cc)) return(0);
|
||||
|
||||
if((cc.x == u.ux) && (cc.y == u.uy)) return(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user