Inform - Support - Patches

About Patches  


DM4 Errata  

Issue L61020

"Can't go that way" message
Submitted by: Brendan Barnwell     Appeared in: Library 6/10 or before     Fixed in: Library 6/11

In Library 6/10 (and possibly earlier -- I don't know), library message #2 for the Go action is, by default, "You can't go that way." However, changing that message by providing a LibraryMessages object does not change the message for the most obvious case -- going in a direction in which there is no exit. For example, if the room the player is in does not provide an n_to property, the command GO NORTH will print "You can't go that way." even if LibraryMessages specifies some different message.


For some bizarre reason, the real location of the message in question is in the CANTGO__TX constant. (The LibraryMessage in question handles the more obscure situation in which the player tries to go in a direction where there is a concealed door.) To fix this and make LibraryMessages work right, the following changes are required:

in English.h, find this line:

  Constant CANTGO__TX = "You can't go that way.";

and change it to:

  Constant CANTGO__TX = 0;

then, in verblibm.h, find the GoSub routine and add the indicated line:

  if (k==0 || j==0)
  {   if (i.cant_go ~= 0) PrintOrRun(i, cant_go);
    else L__M(##Go,2);      ! Add this line

(Note that there are TWO underscores between the L and the M in L__M.)

A side-effect of this patch is that you can no longer have separate messages for the two situations described above (going in a direction with a concealed door and going in a direction not provided by the room). However, at least you can change the message.

Update (by Cedric Knight)

Although this patch has one benefit (ensuring a concealed door is undetectable), it is not true that the default cant_go message cannot be changed without altering the library. Inserting ChangeDefault(cant_go,SomeStringConstant) into Initialise() seems to work. Although it is not documented in DM4, it was in DM3; ChangeDefault doesn't work with routines which seems the more fundamental problem.

Update (by Giancarlo Niccolai and Cedric Knight)

The problem is in the RunRountines() function (called by PrintOrRun() if the thing to print is a routine); currently this routine is:

  [ RunRoutines obj prop;
     if (obj == thedark
         && prop ~= initial or short_name or description) obj=real_location;
     if (obj.&prop == 0) rfalse;
     return obj.prop();

The statement "if (obj.&prop == 0) rfalse;" is uncorrect. A better version would be:

  [ RunRoutines obj prop;
     if (obj == thedark
         && prop ~= initial or short_name or description) obj=real_location;
     if (obj.&prop == 0 && prop >= 64) rfalse;
     return obj.prop();

Last updated 17 April 2013. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Roger Firth.