Problem with new Term_inkey()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • APWhite
    Adept
    • Jul 2007
    • 244

    Problem with new Term_inkey()

    I am working on getting the screensaver and borg running for 309, but I am running into a snag with the new version of the Term_inkey(). The older versions just used a simper char ch to queue up the keys. Now there is an event_type.

    The problem is for some reason, after the borg completes a sale or purchase in the store, it will unhook because the term_inkey() has been altered somehow in the game code. This didn't happen in the old (306) code. The (char) ch changes from 0 (meaning, no keypressed) to a 16. Somehow this is happening in the game code. The borg is not pressing any keys to correspond. Surprisingly, if I convert the old (char) ch into a event_type ch_evt and monitor it, it will return a '2' on a keypress and stop the borg until that initial sale is completed. Once the sale is completed, the ch_evt is returning a 16 each round and the keyboard seems to be disconnected, I cant stop the borg and cannot change the inkey.

    Anyone know why this goofy thing is happening and what I might do to fix it? The borg code is in borg9.c in borg_inkey_hack() lines read:
    Code:
        /* Check for key */
        ch = borg_inkey(TRUE);
    
        /* Use the key */
        if (ch) return (ch);
    
    
        /* Check for user abort */
        (void)Term_inkey(&ch, FALSE, FALSE);
    
        /* User Abort */
        if (ch != 0)
        {
            /* Oops */
            borg_oops("user abort");
    
            /* Hack -- Escape */
            return (ESCAPE);
        }
    so the borg will check for a user keypress (when ch != 0) and if so unhook. Problem is the ch is being altered to a 16 by the game code. If anyone needs the updated 309 borg to test this, let me know. I can post it on the borg page.

    The 309 borg is not ready yet, but I am working on it. He now knows that he is in a store, reads the store inventory and price list. He can make purchases correctly. There are lots of little things to fix before it is ready to release.


    Andrew
    St George Chiropractor
    Angband Borg Homepage
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by APWhite
    so the borg will check for a user keypress (when ch != 0) and if so unhook. Problem is the ch is being altered to a 16 by the game code. If anyone needs the updated 309 borg to test this, let me know. I can post it on the borg page.
    If you send it my way (to the address on the splashscreen) I'll have a go at figuring it out.
    takkaria whispers something about options. -more-

    Comment

    • APWhite
      Adept
      • Jul 2007
      • 244

      #3
      Originally posted by takkaria
      If you send it my way (to the address on the splashscreen) I'll have a go at figuring it out.
      OK, I sent it.

      The borg would be happy using any sort of keypress monitor like inkey(). It does not have to be that particular function. I am not sure if inkey() is already in use in that line or not.

      Andrew
      St George Chiropractor
      Angband Borg Homepage

      Comment

      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎