]> granicus.if.org Git - nethack/commitdiff
U491: xorns, digging and pits
authorcohrs <cohrs>
Mon, 30 Jun 2003 06:08:06 +0000 (06:08 +0000)
committercohrs <cohrs>
Mon, 30 Jun 2003 06:08:06 +0000 (06:08 +0000)
Digging a pit while a xorn set the trap time, but falling into a pit did
not.  While lookin at this, it occurred to me that the same inconsistency
might occur while polymorhing from/to a xorn, and there was.

doc/fixes34.2
src/dig.c
src/polyself.c

index d126cd472231d494ec058de70f358f9893693228..036ca72eddc18fda11049dc6fc863d54cb81179e 100644 (file)
@@ -97,6 +97,7 @@ don't allow polymorphed player to web over the stairs
 geographical shopkeeper updates
 stethoscope use should be free the first time it's use per player move
 travel command caches last position to make non-mouse less painful
+update pit trapped time when polymorphing to or from a monster that passes_walls
 
 
 Platform- and/or Interface-Specific Fixes
index 18e4d096eec1b11efe47f34f0a5ce60fa86c497d..62127500eefc476aeb4678179627b6de11a1f25d 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -549,11 +549,12 @@ int ttyp;
 
            if(at_u) {
                if (!wont_fall) {
+                   if (!Passes_walls)
                        u.utrap = rn1(4,2);
-                       u.utraptype = TT_PIT;
-                       vision_full_recalc = 1; /* vision limits change */
+                   u.utraptype = TT_PIT;
+                   vision_full_recalc = 1;     /* vision limits change */
                } else
-                       u.utrap = 0;
+                   u.utrap = 0;
                if (oldobjs != newobjs) /* something unearthed */
                        (void) pickup(1);       /* detects pit */
            } else if(mtmp) {
index 4590fe7a7f17c83157484c201c0cb0bdd832af5e..d73aefc6b8a39d58fc54cc0f26055b2f45fed317 100644 (file)
@@ -34,7 +34,7 @@ const char *fmt, *arg;
 {
        boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
                was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT);
-
+       boolean could_pass_walls = Passes_walls;
        boolean was_blind = !!Blind;
 
        if (Upolyd) {
@@ -87,6 +87,11 @@ const char *fmt, *arg;
        if (u.twoweap && !could_twoweap(youmonst.data))
            untwoweapon();
 
+       if (u.utraptype == TT_PIT) {
+           if (could_pass_walls) {     /* player forms cannot pass walls */
+               u.utrap = rn1(6,2);
+           }
+       }
        if (was_blind && !Blind) {      /* reverting from eyeless */
            Blinded = 1L;
            make_blinded(0L, TRUE);     /* remove blindness */
@@ -331,6 +336,7 @@ int mntmp;
 {
        boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
                was_blind = !!Blind, dochange = FALSE;
+       boolean could_pass_walls = Passes_walls;
        int mlvl;
 
        if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
@@ -462,6 +468,13 @@ int        mntmp;
        else
                u.uundetected = 0;
 
+       if (u.utraptype == TT_PIT) {
+           if (could_pass_walls && !Passes_walls) {
+               u.utrap = rn1(6,2);
+           } else if (!could_pass_walls && Passes_walls) {
+               u.utrap = 0;
+           }
+       }
        if (was_blind && !Blind) {      /* previous form was eyeless */
            Blinded = 1L;
            make_blinded(0L, TRUE);     /* remove blindness */