*** oldsrc\util\makedefs.c Wed Mar 20 16:44:06 2002 --- util\makedefs.c Fri Jun 21 12:42:36 2002 *************** *** 725,730 **** --- 725,734 ---- #ifdef ZEROCOMP "zero-compressed save files", #endif + #ifdef AUTO_OPEN + "patch: auto open doors", + #endif /* AUTO_OPEN */ + "basic NetHack features" }; *** oldsrc\src\hack.c Wed Mar 20 16:43:06 2002 --- src\hack.c Fri Jun 21 12:42:22 2002 *************** *** 575,580 **** --- 575,581 ---- if ( !test_only ) { if (amorphous(youmonst.data)) You("try to ooze under the door, but can't squeeze your possessions through."); + +#ifndef AUTO_OPEN else if (x == ux || y == uy) { if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { #ifdef STEED *************** *** 584,598 **** u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)); else { ! #else pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); ! #endif #ifdef STEED } ! #endif } else pline("That door is closed."); } } return FALSE; } --- 585,635 ---- u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)); else { ! #else /* STEED */ pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); ! #endif /* STEED */ #ifdef STEED } ! #endif /* STEED */ } else pline("That door is closed."); } + #else /* AUTO_OPEN */ + + /* teppic - begin(autoopen) */ + /* + * prevent doors from being autoopened + * at the end of a diagonal run + */ + else if (flags.run || !iflags.autoopen) { + if (x == u.ux || y == u.uy) { + if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { + #ifdef STEED + if (u.usteed) + You_cant("lead %s through that closed door.", + x_monnam(u.usteed, + u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, + (char *)0, SUPPRESS_SADDLE, FALSE)); + else { + #else /* STEED */ + + pline("Ouch! You bump into a door."); + exercise(A_DEX, FALSE); + #endif /* STEED */ + #ifdef STEED + } + #endif /* STEED */ + + } else pline("That door is closed."); + } + } + else { + flags.move = doopen_indir(FALSE); + } + /* teppic - end(autoopen) */ + + #endif /* AUTO_OPEN */ + } return FALSE; } *** oldsrc\src\lock.c Wed Mar 20 16:43:08 2002 --- src\lock.c Fri Jun 21 12:07:06 2002 *************** *** 490,495 **** --- 490,504 ---- int doopen() /* try to open a door */ { + #ifdef AUTO_OPEN + return doopen_indir(TRUE); + } + + int + doopen_indir(doprompt) /* try to open a door in direction u.dx/u.dy */ + boolean doprompt; /* if true, prompt for direction */ + { + #endif /* AUTO_OPEN */ register int x, y; register struct rm *door; struct monst *mtmp; *************** *** 504,510 **** --- 513,524 ---- return 0; } + #ifndef AUTO_OPEN + if(!getdir((char *)0)) return(0); + #else + if (doprompt) if(!getdir((char *)0)) return(0); + #endif /* AUTO_OPEN */ x = u.ux + u.dx; y = u.uy + u.dy; *** oldsrc\src\options.c Wed Mar 20 16:43:12 2002 --- src\options.c Fri Jun 21 12:12:48 2002 *************** *** 45,50 **** --- 45,53 ---- {"asksavedisk", (boolean *)0, FALSE, SET_IN_FILE}, #endif {"autodig", &flags.autodig, FALSE, SET_IN_GAME}, + #ifdef AUTO_OPEN + {"autoopen", &iflags.autoopen, TRUE, SET_IN_GAME}, + #endif /* AUTO_OPEN */ {"autopickup", &flags.pickup, TRUE, SET_IN_GAME}, {"autoquiver", &flags.autoquiver, FALSE, SET_IN_GAME}, #if defined(MICRO) && !defined(AMIGA)