]> Pileus Git - ~andy/rhawk/blobdiff - spades.awk
Add Meetup polling for SFVLUG
[~andy/rhawk] / spades.awk
index fee89509557a8747f35e33d756cc4a28c704cf95..50952f182b4e8f13ae13d4a641a442bcd88ed529 100644 (file)
@@ -709,9 +709,6 @@ sp_state == "play" &&
        if (!(_card in sp_deck)) {
                reply("Invalid card")
        }
-       else if (!(_card in sp_hands[sp_from])) {
-               reply("You do not have that card")
-       }
        else if (sp_suit && _card !~ sp_suit && sp_hasa(sp_from, sp_suit)) {
                reply("You must follow suit (" sp_suit ")")
        }
@@ -721,6 +718,9 @@ sp_state == "play" &&
        else if (_card ~ /s/ && length(sp_pile) == 0 && sp_hasa(sp_from, "[^s]$") && !sp_broken) {
                reply("Spades have not been broken")
        }
+       else if (!(_card in sp_hands[sp_from])) {
+               reply("You do not have that card")
+       }
        else {
                sp_play(_card)
                if (sp_state == "play") {
@@ -760,8 +760,8 @@ sp_state == "play" &&
 
        if (/!!/ && (sp_state == "bid" || sp_state == "play")) {
                if (sp_player in sp_notify) {
-                       if (!_bids) _bids = "none"
-                       if (!_pile) _pile = "none"
+                       _bids = _bids ? _bids    : "none"
+                       _pile = _pile ? sp_piles : "none"
                        mail_send(sp_notify[sp_player],     \
                                "It is your " sp_state "!", \
                                "Bids so far:  " _bids "\n" \