the-infocom-files / zork1

Zork I: The Great Underground Empire
11 stars 3 forks source link

"CLOSE TRAP DOOR" is buggy from the cellar #60

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

If the trap door is closed:

>CLOSE TRAP DOOR
Have your eyes checked.

If the trap door is closed:

>CLOSE TRAP DOOR
The door closes and locks.

So the two messages have been swapped. Here is the code from TRAP-DOOR-FCN:

      (<EQUAL? ,HERE ,CELLAR>
       <COND (<AND <VERB? OPEN UNLOCK>
               <NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
          <TELL
"The door is locked from above." CR>)
         (<AND <VERB? CLOSE> <NOT <FSET? ,TRAP-DOOR ,OPENBIT>>>
          <FCLEAR ,TRAP-DOOR ,TOUCHBIT>
          <FCLEAR ,TRAP-DOOR ,OPENBIT>
          <TELL "The door closes and locks." CR>)
         (<VERB? OPEN CLOSE>
          <TELL <PICK-ONE ,DUMMY> CR>)>)>>

It looks like a simple cut-and-paste error. When trying to open door, it checks that the door is closed with <NOT <FSET? ,TRAP-DOOR ,OPENBIT>>. When trying to close the door, it uses the exact same test to see if it's closed.

It should almost certainly be <AND <VERB? CLOSE> <FSET? ,TRAP-DOOR ,OPENBIT>> instead.

It looks like it was fixed in the 1987 version of Mini-Zork I.