ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
66 stars 13 forks source link

BUG (and fix?) - Nothing prints when the player enters only 'X' #36

Closed KVonGit closed 3 years ago

KVonGit commented 3 years ago

Hello!

This is not that important, but I feel the game should always print a response, even if the player only enters 'X'.

Starting on line 167 in '_parser.js':

    if (candidates.length === 0) {
      parser.msg("There were no candidates.") //KV added this
      msg(lang.not_known_msg)  //KV added this
      return lang.not_known_msg;  //Note from KV: This line makes this print out via debugmsg when PARSER command has been entered, but I left it in so the return would exit this function.
    }

EDIT

I actually think you want to edit the code that calls this to make it print the debugmsg rather than send it to console.log, but I can't find the line of code now. (I found it earlier, before I had to run somewhere. Curses!)

ThePix commented 3 years ago

Do you mean the player types X and then return? I get a message when I do it. "I don't even know where to begin with that."

KVonGit commented 3 years ago

Do you mean the player types X and then return? I get a message when I do it. "I don't even know where to begin with that."

Affirmative. Just X and ENTER.

If it prints the message for you, I probably messed that up in my file somehow while fooling around and testing out things, then.

I'll check the code on here next time, to make sure it's the same thing I'm looking at.

"Doh!" - H. Simpson