the-infocom-files / starcross

Starcross
5 stars 3 forks source link

Bug in HATCH-CLOSE (triggers Frotz warning) #44

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago
>PUT SILVER ROD IN SILVER SLOT
The silver rod slides into the slot and the hatch opens.

>GET SILVER ROD
The hatch closes silently.
Warning: @clear_attr called with object 0 (PC = ec8b) (will ignore further
occurrences)

That's because of the HATCH-CLOSE routine:

<ROUTINE HATCH-CLOSE (HATCH "AUX" CONT)
     <COND (<VERB? TAKE>
        <SET CONT <FIRST? .HATCH>>
        <COND (<TRYTAKE>
               <TELL
"The " D .HATCH " closes silently." CR>
               <FCLEAR .CONT ,NDESCBIT>
               <FCLEAR .HATCH ,OPENBIT>)>)>>

I assume it's supposed to clear NDESCBIT from the rod here. But the rod was in the slot, not the hatch itself. The only way around it I can think of is to let the routine take two parameters, the hatch and the slot.

eriktorbjorn commented 5 years ago

Also, I'm not sure what the purpose of TRYTAKE is here.