From: cohrs Date: Mon, 14 Jul 2003 05:57:11 +0000 (+0000) Subject: B03008 - stop_occupation while digging in a pit X-Git-Tag: MOVE2GIT~1899 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17b7bc1bd614d8296b56e62ee2f643ff410ce2af;p=nethack B03008 - stop_occupation while digging in a pit 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. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 55c4301c0..3dc3aa564 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -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 diff --git a/src/monmove.c b/src/monmove.c index 5dc384f65..f0d1a156e 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -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(); diff --git a/src/vision.c b/src/vision.c index de9099307..e614bdd9d 100644 --- a/src/vision.c +++ b/src/vision.c @@ -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,