Open eriktorbjorn opened 4 years ago
Looking through the window on the other side has its own issues:
>LOOK THROUGH WINDOW
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb. On the north side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole lies within the lock.
How can you see the door, when you're looking through a window on the other side of it?
Also, the Tiny Room isn't lit. The dreary room is lit, so we can turn off the lamp without any danger.
>TURN OFF LAMP
The lamp is now off.
>LOOK THROUGH WINDOW
It is pitch black. You are likely to be eaten by a grue.
No, I'm not! I'm in a lit room. :-)
You can look through the windows even when they're closed, but I don't consider that a bug since they are described as "barred". So I guess you can look through the bars either way.
On second thought, they probably left a space at the end of the message so that P-DOOR
could append to the description.
Looking through window into the Tiny Room actually shouldn't show the door description, because it's printed by P-DOOR
and that one only prints the description if PLOOK-FLAG
is false.
So why doesn't it work here?
The flag is cleared whenever PCHECK
is called. It's called from both TINY-ROOM-FCN
and DREARY-ROOM-FCN
, but not quite the same way:
TINY-ROOM-FCN
:
(<NOT <VERB? LOOK>> <PCHECK> <RFALSE>)>>
DREARY-ROOM-FCN
:
(T <PCHECK> <RFALSE>)>>
Changing both to do the same thing seems to fix this glitch.
So my suggestion for fixing the bug, then, is:
(T <PCHECK> <RFALSE>)
in DREARY-ROOM-FCN
to (<NOT <VERB? LOOK>> <PCHECK> <RFALSE>)
. I'm not sure of the exact implications, but it matches the presumably more well tested code in TINY-ROOM-FCN
.TINY-ROOM-FCN
and DREARY-ROOM-FCN
PDOOR
when the function describes the door.PLOOK-FLAG
is false, print a newline before returning in P-DOOR
.This is what it looks like in action:
Looking in the Tiny Room:
>LOOK
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb. On the north side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole covered by a thin metal lid lies within the lock.
Looking into the Dreary Room:
>LOOK THROUGH WINDOW
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room.
In the center of the table sits a blue crystal sphere.
Looking in the Dreary Room:
Dreary Room
This is a small and rather dreary room, eerily illuminated by a red glow
emanating from a crack in one wall. The light falls upon a dusty wooden table in
the center of the room. On the south side of the room is a massive wooden door,
which has a small window barred with iron. A formidable bolt lock is set within
the door frame. A keyhole lies within the lock.
In the center of the table sits a blue crystal sphere.
Looking into the Tiny Room:
>LOOK THROUGH WINDOW
Tiny Room
This is a tiny room carved out of the wall of the ravine. There is an exit down
a precarious climb.
There is a place mat here.
There should be a line break before the prompt. In superbrief mode, the prompt doesn't even get its own line. It's printed after "center of the room." instead.
This is what it looks like if the sphere is on the table, and hasn't been touched yet:
If you enter the room, the contents on the table is on a separate line:
They probably wanted the sphere description to appear on the same line as the "in the center of the room." part of the room description, because in
DREARY-ROOM-FCN
the description ends with a space, not aCR
. But it does cause problems if the table is empty.