DrawMyThing: Remove all found words from the checked string when looking for multiple guesses
This commit is contained in:
parent
67f1e4ad1f
commit
091f98fa9d
@ -300,16 +300,17 @@ public class Draw extends SoloGame
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
String message = event.getMessage().toLowerCase();
|
||||
|
||||
if (_guessers.HasPlayer(player))
|
||||
{
|
||||
int wordsInMessage = 0;
|
||||
String message = event.getMessage().toLowerCase().replace(_round.Word.toLowerCase(), "");;
|
||||
|
||||
for (String word : _words)
|
||||
{
|
||||
if (!word.equals(_round.Word) && message.contains(word.toLowerCase()))
|
||||
if (message.contains(word.toLowerCase()))
|
||||
{
|
||||
message = message.replace(word.toLowerCase(), "");
|
||||
|
||||
if (++wordsInMessage >= 3)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "Multiple guesses are not allowed!"));
|
||||
@ -320,7 +321,7 @@ public class Draw extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
if (message.contains(_round.Word.toLowerCase()))
|
||||
if (event.getMessage().toLowerCase().contains(_round.Word.toLowerCase()))
|
||||
{
|
||||
// First Guess
|
||||
int score = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user