]> granicus.if.org Git - nethack/commitdiff
B03008 - stop_occupation while digging in a pit
authorcohrs <cohrs>
Mon, 14 Jul 2003 05:57:11 +0000 (05:57 +0000)
committercohrs <cohrs>
Mon, 14 Jul 2003 05:57:11 +0000 (05:57 +0000)
If you dug in a pit next to a sleeping, angry monster, you'd stop every
turn due to a complex check at the end of dochugw.  It turned out this
was due to a long-standing bug in the special case vision code that failed
to set the COULD_SEE bit for the locations where it set the IN_SIGHT bit.
It looks like the underwater code had the same problem (it didn't set the
bit, obviously there are no pits underwater).  However, the same could
occur if you see the angry, sleeping monster with Xray vision.  In this
case, setting COULD_SEE is not appropriate, so added a mcanmove check to
the complex check in dochugw.

doc/fixes34.2
src/monmove.c
src/vision.c

index 55c4301c0e7802d1e26f31402fc82cac5d6706cb..3dc3aa564daa96ef9e61fe865370172795fb5de5 100644 (file)
@@ -103,6 +103,7 @@ revived pet corpse from bones file should not be loyal to current player
 finding a statue trap you are about to dig should stop your occupation
 try to keep saddle at the same location as the steed corpse
 never display I symbol on the mounted hero/steed location
+pit digging is no longer stopped by a sleeping monster next to you
 
 
 Platform- and/or Interface-Specific Fixes
index 5dc384f65d97625bb76caed92cf9b7d7897fc655..f0d1a156e474380caab7879a4c8ce8c1648f0425 100644 (file)
@@ -116,6 +116,7 @@ dochugw(mtmp)
            /* can see it now, or sense it and would normally see it */
            (canseemon(mtmp) ||
                (sensemon(mtmp) && couldsee(mtmp->mx,mtmp->my))) &&
+           mtmp->mcanmove &&
            !noattacks(mtmp->data) && !onscary(u.ux, u.uy, mtmp))
                stop_occupation();
 
index de90993078c66897d92e728a1e54bbfb49c4c25f..e614bdd9d009448e2bc52f4190f10fcb39eed28f 100644 (file)
@@ -587,7 +587,7 @@ vision_recalc(control)
 
                    next_rmin[row] = min(next_rmin[row], col);
                    next_rmax[row] = max(next_rmax[row], col);
-                   next_array[row][col] = IN_SIGHT;
+                   next_array[row][col] = IN_SIGHT | COULD_SEE;
                }
        }
 
@@ -601,7 +601,7 @@ vision_recalc(control)
                next_row = next_array[row];
 
                for(col=next_rmin[row]; col <= next_rmax[row]; col++)
-                   next_row[col] = IN_SIGHT;
+                   next_row[col] = IN_SIGHT | COULD_SEE;
            }
        } else
            view_from(u.uy, u.ux, next_array, next_rmin, next_rmax,