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:
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
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); }
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
Comment