Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L61107     [previous patch]

(The) with 'proper' should capitalise object name
Submitted by: Roger Firth     Appeared in: Library 6/11 or before     Fixed in: -
Problem

In the case of an object with the 'proper' attribute and a lower-case name (such as "your nose", "your corduroy trousers", "your mother's purse"), the (The) print rule should capitalise the first letter of the object name, so that library messages such as (The) x1, " ", (isorare) x1, " empty." correctly produce "Your mother's purse is empty."

Solution (by Fredrik Ramsberg)

Create a new global caps_mode and replace CDefart() in parserm.h:

  [ CDefart o
      saveIndef saveCaps;
      #Ifdef YOU__TX;
      if (o == player) {
          print (string) YOU__TX;
          return;
      }
      #Endif;
      saveIndef = indef_mode; indef_mode = false;
      saveCaps  = caps_mode;  caps_mode  = true;
      if (~~o ofclass Object) {
          indef_mode = NULL; print (PSN__) o;
      }
      else
          if (o has proper) {
              indef_mode = NULL;
              PrintToBuffer(StorageForShortName, 160, PSN__, o);
              if (caps_mode)
                  StorageForShortName->WORDSIZE =
                    UpperCase(StorageForShortName->WORDSIZE);
              for (o=0 : o<StorageForShortName-->0 : o++)
                  print (char) StorageForShortName->(o+WORDSIZE);
          }
          else
              PrefaceByArticle(o, 0);
     indef_mode = saveIndef; caps_mode = saveCaps;
  ];

The same kind of patch should probably be done for CInDefart() as well. To make the code safer, Indefart() and Defart() should also be modified to set caps_mode to false, in case game code sets it to true. Since the variable should be changable by game code, we have to count on game code changing it, and sometimes carelessly so.


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.