the-infocom-files / infidel

Infidel
3 stars 3 forks source link

The room doesn't go dark if you pour water (or sand) on the only light source #60

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

There's this code in PRE-POUR-ON that extinguishes flaming objects if you pour water or sand on them:

              (<FLAMING? ,PRSI>
               <TELL "Poured." CR>
               <COND (,LIT
                  <SETG LIT <LIT? ,HERE>>)>
               <COND (<NOT <SETG LIT <LIT? ,HERE>>>
                  <TELL " It is now pitch black.">)>
               <COND (<EQUAL? .LIQ ,WATER>
                  <SETG WATER-LEFT <- ,WATER-LEFT 10>>
                  <COND (<L? ,WATER-LEFT 10>
                     <REMOVE ,WATER>)>)
                 (T
                  <SETG SAND-FILLED <>>
                  <REMOVE ,C-SAND>)>
               <FCLEAR ,PRSI ,FLAMEBIT>
               <FCLEAR ,PRSI ,ONBIT>
               <RTRUE>)

But the room doesn't go dark even if PRSI was the only light source. That's probably because the object is still burning. Those checks have to be made after the object is extinguished.

I have a feeling that if that fix is made, the "It is now pitch black." will look strange because there's a space at the beginning of it.

It's also possible that the torch should be extinguished by calling KILL-TORCH instead. I'm not sure about the match.