]> Pileus Git - ~andy/spades/blobdiff - src/org/pileus/spades/Spades.java
Fix null pointers and pile parsing
[~andy/spades] / src / org / pileus / spades / Spades.java
index f7924bc8f17b8bcb4b3870b7d8cd32ad5af92a04..17eacfaa99259d8073d799e1a613d831751ebc82 100644 (file)
@@ -10,7 +10,7 @@ public class Spades
        /* Static methods */
        private static String[] getCards(String msg, String regex)
        {
-               String cards = Message.clean(msg)
+               String cards = msg
                        .replaceAll(regex, "$1")
                        .replaceAll(",", " ")
                        .replaceAll("♠", "s")
@@ -41,8 +41,8 @@ public class Spades
                        this.cards.hand = Spades.getCards(txt, "You have: (.*)");
                        this.cards.requestRender();
                }
-               if (txt.matches("turn!")) {
-                       this.cards.pile = Spades.getCards(txt, ".*turn! (.*)");
+               if (txt.matches(".*turn!.*")) {
+                       this.cards.pile = Spades.getCards(txt, ".*turn! \\((.*)\\)");
                        this.cards.requestRender();
                }
        }