!  Number.h                     A fix for the inform number bug.
!
!                               By L. Ross Raszewski
!
!
!  This is a proposed fix for the "three bug" in inform 6/5
!  specifically, if you have, in your game, a "three", and you attempt to 
!  refer to it as such, the game will think you meant three of something.
!
!  Replace the game's NumberWord sub, and include this file.  That should fix 
!  the bug.
!
! this is not a complete nor an elegant solution.  As soon as Graham fixes the 
! library, please dispense with this.
!
!
!  Advertisement (sorry):
!
!  USE ALTMENU.H by me.  A fast and easy way to do menus.
!
!       No.  It's not as inpressive as Graham's version, but it's just as 
!      easy, and has an extra feature or two..
!

[ NumberWord o i n q;
  objectloop(q near player) { if (CheckNumberOut(q,o)==1) return 0;};
  objectloop(q in player) { if (CheckNumberOut(q,o)==1) return 0;};
  n = LanguageNumbers-->0;
  for (i=1:i<=n:i=i+2)
      if (o == LanguageNumbers-->i)
          return LanguageNumbers-->(i+1);
  return 0;
];
[ CheckNumberOut obj wd k l m;
    if (parser_inflection >= 256)
    {   k = indirect(parser_inflection, obj, wd);
        if (k>=0) return k;
        m = -k;
    } else m = parser_inflection;
    k=obj.&m; l=(obj.#m)/2-1;
    for (m=0:m<=l:m++)
        if (wd==k-->m) rtrue;
    rfalse;
];
