the-infocom-files / leathergoddesses

Leather Goddesses of Phobos
4 stars 3 forks source link

(Not a bug... in this game) V-WEAR lets you take clothes from closed, transparent containers #35

Open eriktorbjorn opened 3 years ago

eriktorbjorn commented 3 years ago

This isn't really a bug, since I can't find any way to exploit it, but the "WEAR" command doesn't check if you are holding the object you're trying to wear:

>PUT SUIT IN BASKET
Done.

>WEAR SUIT
You're now wearing the white suit.

This isn't a problem in the game, because V-WEAR moves the worn object to the player:

           (T
        <TELL "You're ">
        <COND (<FSET? ,PRSO ,WORNBIT>
               <TELL "already">)
              (T
               <MOVE ,PRSO ,PROTAGONIST>
               <FSET ,PRSO ,WORNBIT>
               <TELL "now">)>
        <TELL " wearing" TR ,PRSO>)>>

But if there had been a closed, transparent container in the game, this would have been a problem. Just to test, I added the following objects to the game:

<OBJECT GLASS-BOX
    (IN PROTAGONIST)
    (SDESC "glass box")
    (SYNONYM BOX)
    (ADJECTIVE GLASS)
    (FLAGS CONTBIT TAKEBIT TRANSBIT SEARCHBIT)
    (CAPACITY 20)
    (SIZE 5)
    (ACTION GLASS-BOX-F)>

<ROUTINE GLASS-BOX-F ()
     <COND (<VERB? OPEN>
            <TELL "The box has no obvious lid." CR>)
           (<VERB? CLOSE>
            <TELL "It already is." CR>)>>

<OBJECT FELT-HAT
    (IN GLASS-BOX)
    (SDESC "felt hat")
    (NO-T-DESC "fel ha")
    (SYNONYM HAT HA)
    (ADJECTIVE FELT FEL)
    (FLAGS TAKEBIT WEARBIT)
    (SIZE 2)>

Now you can get this:

>TAKE HAT
You'll have to open the glass box first.

>OPEN BOX
The box has no obvious lid.

>WEAR HAT
You're now wearing the felt hat.
eriktorbjorn commented 3 years ago

CLOTHES-PIN-F would have the same potential problem, since it also moves the object:

              (T
               <MOVE ,CLOTHES-PIN ,PROTAGONIST>
               <FSET ,CLOTHES-PIN ,WORNBIT>
               <FSET ,NOSE ,MUNGBIT>
               <TELL "You pin your proboscis." CR>)>)

But I guess this shouldn't be fixed either.