From 21f8f3c057393f1f938ce1fe7e0de7ebcf49729f Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Wed, 17 Aug 2016 16:41:46 -0400 Subject: [PATCH] Fixed case bug --- lib/commands/Hangman.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands/Hangman.js b/lib/commands/Hangman.js index ac597af..f3c6278 100644 --- a/lib/commands/Hangman.js +++ b/lib/commands/Hangman.js @@ -56,9 +56,10 @@ module.exports = new Command("Hangman", condition, function(text, send, userData if (guessedLetters.indexOf(letter) !== -1) { send("You already guessed this letter"); } else { - if (word.toLowerCase().indexOf(letter.toLowerCase()) !== -1) { + letterIndex = word.toLowerCase().indexOf(letter.toLowerCase()); + if (letterIndex !== -1) { send("The letter is in the word!"); - correctLetters.push(letter); + correctLetters.push(word[letterIndex]); } else { send("The letter is not in the word.."); }