Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L60709

Implementing a clock
Submitted by: Torbjörn Andersson     Appeared in: Library 6/7 or before     Fixed in: Library 6/11
Problem

Suppose you want to put a clock in your game. The simplest method would probably be to use the SetTime() function provided by the Inform library, but there is a problem with this. The status line will start displaying hours and minutes instead of score and moves but it will still use the score/moves layout.

This is because DrawStatusLine() - which draws the status line -- checks a header flag to see which layout to use, while DisplayStatus() -- which decides what values to print in the status line - checks the value of the_time.

Solution

Changing the if-statement in DisplayStatus() from

  if (the_time==NULL)

to

  if ((0->1)&2 == 0)

should take care of this.


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.