Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L61011

Move count starts at 1
Submitted by: Matthew Auger     Appeared in: Library 6/7 or before     Fixed in: Library 6/11
Problem

Maybe I'm being really picky but every game I've seen that has been compiled with Inform sets the initial moves to one. Now I may be missing something but I am under the impression that this should be zero.

Solution

The "bug" (or maybe just general annoyance) is quite easily fixed by finding the line in Parserm.h:

  Global turns = 1;

and changing it to:

  Global turns = 0;

There is a further minor correction that must be made to Parserm.h so that the game accepts that the move counter starts at zero. On the first turn the library is set to respond [You can't "undo" what hasn't been done!] to an attempt to "undo". If the first turn is numbered anything other than 1 the game will respond [Your interpreter does not provide "undo". Sorry!] even if it does, and then when turn 1 comes around it will refuse to undo the previous turn.

This can be corrected by changing part of Parserm.h which may look like this:

  if ((w == UNDO1__WD or UNDO2__WD or UNDO3__WD) && (parse->1==1))
      {   if (turns==1)

or if you have made Torbjörn Andersson's "undo" correction like this:

  if ((w == UNDO1__WD or UNDO2__WD or UNDO3__WD) && (nw==1))
      {   if (turns==1)

The second line should be changed to:

      {   if (turns==0)

Then the game will disallow "undo" properly on turn 0 and allow it on turn 1.


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.