Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L60703

SAVE/RESTORE messages mixed up
Submitted by: Torbjörn Andersson     Appeared in: Library 6/7 or before     Fixed in: Library 6/10
Problem

On successful RESTORE, the library message for successful SAVE is printed. This is because the @restore opcode will restore the game to the point where it was saved, which was in SaveSub(). Few notice this because it's not obvious from the code and by default these two messages are the same anyway.

Solution

The following SaveSub() replacement should work:

  [ SaveSub flag;
      @save -> flag;
      switch (flag) {
       0: L__M(##Save, 1);
       1: L__M(##Save, 2);
       2: L__M(##Restore, 2);
      }
  ];

Note: This form of the @save opcode was introduced in version 5 of the Z-machine, so this will not work with earlier versions.


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.