Skip to content

Commit 2240a7d

Browse files
committed
Fix: arena door didn't shut if hero stepped off it normally
1 parent f39a49f commit 2240a7d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/tnnt.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,9 +1745,13 @@ shut_the_front_door(void)
17451745
return;
17461746
for (x = 1; x < COLNO; x++) {
17471747
for (y = 0; y < ROWNO; y++) {
1748-
if (IS_DOOR(levl[x][y].typ)
1749-
/* this shouldn't happen but in case... */
1750-
&& x != u.ux && y != u.uy) {
1748+
/* there used to be a check for (x, y) != (ux, uy), but since this
1749+
* is called from an in_out_region callback, the hero hasn't
1750+
* actually moved yet and will, in most cases, be occupying the door
1751+
* space. Assume the region is properly set up such that it does NOT
1752+
* contain the door, so if we're entering it the hero will not end
1753+
* up on the door. */
1754+
if (IS_DOOR(levl[x][y].typ)) {
17511755
boolean wasopen = (levl[x][y].doormask != D_CLOSED
17521756
&& levl[x][y].doormask != D_LOCKED);
17531757
levl[x][y].doormask = D_LOCKED;

0 commit comments

Comments
 (0)