Inform - Support - Patches

About Patches  


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: -

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;
      saveIndef = indef_mode; indef_mode = false;
      saveCaps  = caps_mode;  caps_mode  = true;
      if (~~o ofclass Object) {
          indef_mode = NULL; print (PSN__) o;
          if (o has proper) {
              indef_mode = NULL;
              PrintToBuffer(StorageForShortName, 160, PSN__, o);
              if (caps_mode)
                  StorageForShortName->WORDSIZE =
              for (o=0 : o<StorageForShortName-->0 : o++)
                  print (char) StorageForShortName->(o+WORDSIZE);
              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 site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Roger Firth.