File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments