Wrong perception room bugs
There are a couple of bugs related to wrong perception rooms, but I think all has the same root cause:
Naturally generated doorways acts only partly as if they were part of the room.
Entering a doorway square gives the room message but commands that asks for direction have inverted controls (I think this is as it's supposed to be). However move commands are not inverted.
This causes at least following bugs:
1) Standing on a doorway and walking (with w#) towards the room may cause even hundreds of turns to pass. (works better when done diagonally, trying to walk orthogonally requires some additional conditions like digging a few extra spaces around the door)
2) Moving and kicking on a doorway affects in opposite directions.
3) All actions in self-made doorways are completely inverted as supposed, but this behaviour is different from other doorways. Corridors on 3 bottom rows of the room are made with wand of digging so even moving is inverted on those squares. Bugs 1 and 2 are not reproducible on these squares.
How to reproduce 1 and 2 with attached save file:
1) Hit w1 or w3 and observe turn counter.
2) 'k'ick and choose direction 8, you'll kick south (at the fortune cookie). Move to direction 8, you'll move to north.