Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L60706

TAKE/REMOVE messages mixed up
Submitted by: Adam Cadre     Appeared in: Library 6/7 or before     Fixed in: Library 6/10
Problem

Take is the Inform verb for taking objects off the floor; Remove is the verb for taking them out of containers. (This is not to be confused with TAKE THING vs. REMOVE THING -- I'm speaking of the names of the verbs in the source code, not the dictionary words.) Thus, it's often desirable to have two different "after" messages for each verb:

  after [;
     Take: "You reel the black cable out a bit.";
     Remove:
       "You pull the cable out of the input jack.";
  ];

The problem is that the unmodified library produces the following transcript:

  >TAKE CABLE
  You reel the black cable out a bit.

  >PUT CABLE IN JACK
  You plug the black cable into the input jack.

  >TAKE CABLE
  You reel the black cable out a bit.
Solution

The lines producing this unfortunate behavior are found in VerbLibm.h:

  [ RemoveSub i;
    i=parent(noun);
    if (i has container && i hasnt open) return L__M(##Remove,1,noun);
    if (i~=second) return L__M(##Remove,2,noun);
    if (i has animate) return L__M(##Take,6,i);
    if (AttemptToTakeObject(noun)) rtrue;
    action=##Take;   if (AfterRoutines()==1) rtrue;
    action=##Remove; if (AfterRoutines()==1) rtrue;

    if (keep_silent==1) rtrue;
    return L__M(##Remove,3,noun);
  ];

Note that if there is an after routine for Take, it will override the after routine for Remove -- even though this is the Remove routine! To give Remove its proper precedence over the less specific Take, simply switch the two lines beginning with "action".


Last updated 2 May 2008. The librarian in charge of this page is Roger Firth. Please email any comments, suggestions or corrections to roger@firthworks.com.