From 484d8f3e9686b1d28a13c8780d38b9da7e649a36 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 26 Jan 2017 22:28:07 +0100 Subject: [PATCH] closes #1012, Fixed acrophobia not working if you type something other than the sentence --- src/NadekoBot/Modules/Games/Commands/Acropobia.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Games/Commands/Acropobia.cs b/src/NadekoBot/Modules/Games/Commands/Acropobia.cs index b379e473..ff0cc725 100644 --- a/src/NadekoBot/Modules/Games/Commands/Acropobia.cs +++ b/src/NadekoBot/Modules/Games/Commands/Acropobia.cs @@ -191,9 +191,6 @@ namespace NadekoBot.Modules.Games try { await channel.EmbedAsync(GetEmbed()).ConfigureAwait(false); } catch { } } - //user didn't input something already - if (!usersWhoSubmitted.Add(guildUser.Id)) - return; var inputWords = input.Split(' '); //get all words if (inputWords.Length != startingLetters.Length) // number of words must be the same as the number of the starting letters @@ -207,9 +204,15 @@ namespace NadekoBot.Modules.Games return; } + + if (!usersWhoSubmitted.Add(guildUser.Id)) + return; //try adding it to the list of answers if (!submissions.TryAdd(input, guildUser)) + { + usersWhoSubmitted.TryRemove(guildUser.Id); return; + } // all good. valid input. answer recorded await channel.SendConfirmAsync("Acrophobia", $"{guildUser.Mention} submitted their sentence. ({submissions.Count} total)");