the-infocom-files / starcross

Starcross
5 stars 3 forks source link

Shaking an open container while there are objects inside it hangs the game #50

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

You can test this with the metal basket, putting some rods in it first.

The problem is in V-SHAKE:

     (<AND <FSET? ,PRSO ,OPENBIT> <FIRST? ,PRSO>>
      <REPEAT ()
          <COND (<SET X <FIRST? ,PRSO>> <MOVE .X ,PRSO>)
            (ELSE <RETURN>)>>
      <TELL "All of the objects spill onto the floor." CR>)>>

As long as there are objects in PRSO, move the first object into PRSO? As a teacher of mine once said, even a Cray will need several minutes to run an infinite loop...

Some other games, e.g. Infidel and Cutthroats, has similar code, but there the object is moved to HERE instead. But just fixing the loop won't be enough either. There are several rooms where dropping an object will cause it to disappear away. At a quick glance, at least:

Being able to drop objects there by shaking the basket would be unfortunate.

eriktorbjorn commented 5 years ago

By the way, this is probably the same issue as the one described in the Winter 1984 edition of The New Zork Times:

"Zork I, being our oldest game, contains some classic InfoBugs in its early version. Shaking any non-empty open container may cause a crash."

eriktorbjorn commented 5 years ago

There's code in ITAKE to deal with fumbling in various rooms, but I don't know if it's enough to cover all cases for this.