]> gitweb.pimeys.fr Git - bots/hung.git/blobdiff - hung.py
Stay away from here, cretin
[bots/hung.git] / hung.py
diff --git a/hung.py b/hung.py
index 674c09ebb04888cd963a64b1004cf61c5325ccfa..76168026bb3d7447c32db8c8ca5dc93bce37dedd 100755 (executable)
--- a/hung.py
+++ b/hung.py
@@ -325,7 +325,7 @@ class Hung(ircbot.SingleServerIRCBot):
         indice = random.randrange(0,len(mots))
         mot,definition=mots[indice],defs[indice]
         # ' et - sont considérés comme déjà devinés
-        mot = [(lettre,lettre in "'-()") for lettre in list(mot)]
+        mot = [(lettre,lettre in config.non_guess_chars) for lettre in list(mot)]
         self.play_status[canal]=[mot,definition,{}]
         self.tried_letters[canal] = set ()
         self.lives[canal] = config.lives
@@ -424,7 +424,7 @@ class Hung(ircbot.SingleServerIRCBot):
                         serv.privmsg(canal,"%s: %s"%(auteur,ligne.encode("utf8")))
             # on essaye de voir si le mot fourni matche la partie en cours
             mot = cmd
-            if self.play_status[canal][0]!=None and is_mot(mot, self.play_status[canal][0]):
+            if canal in self.play_channels and self.play_status[canal][0]!=None and is_mot(mot, self.play_status[canal][0]):
                 # on a trouvé le mot
                 # on regarde combien de lettre il manquait
                 manquait = sum([not lettre[1] for lettre in self.play_status[canal][0]])