Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L61111     [previous patch]

Multiple AGAINs treated as one
Submitted by: Cedric Knight     Appeared in: Library 6/11 or before     Fixed in: -
Problem

A line consisting just of AGAIN does only one action. For example:

  >Z
  Time passes.

  >G.G.G
  Time passes.

  >Z.G.G
  Time passes.
  Time passes.
  Time passes.

>
Solution

One way is to splice what follows AGAIN onto the end of buffer3 in Parser_parse, instead of simply copying buffer3 back. Add the following:

  if (WordAddress(verb_wordnum) == buffer + WORDSIZE) { ! not held back
      ! splice rest of buffer onto end of buffer3
      #Ifdef TARGET_ZCODE;
      i = buffer3->1;
      #Ifnot; ! TARGET_GLULX
      i = buffer3-->0;
      #Endif;
      while (buffer3->(i + WORDSIZE - 1) == ' ' or '.')
          i--;
      j = i - WordLength(verb_wordnum);  ! amount to move buffer up by
      if (j > 0) {
          for (m=INPUT_BUFFER_LEN-1 : m>=WORDSIZE+j : m--)
              buffer->m = buffer->(m-j);
          #Ifdef TARGET_ZCODE;
          buffer->1 = buffer->1 + j;
          #Ifnot; ! TARGET_GLULX
          buffer-->0 = buffer-->0 + j;
          #Endif;
          }
      for (m=WORDSIZE : m<WORDSIZE+i : m++) buffer->m = buffer3->m;
      if (j < 0) for (:m<WORDSIZE+i-j : m++) buffer->m = ' ';
  }
  else

before:

  for (i=0 : i<INPUT_BUFFER_LEN : i++) buffer->i = buffer3->i;


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.