]> Pileus Git - ~andy/rhawk/commitdiff
Change order of error messages
authorAndy Spencer <andy753421@gmail.com>
Tue, 4 Nov 2014 05:00:41 +0000 (05:00 +0000)
committerAndy Spencer <andy753421@gmail.com>
Tue, 4 Nov 2014 05:00:54 +0000 (05:00 +0000)
This way the other players don't learn information about your hand (i.e.
that you do not have a card) if you accidentally play the wrong suit.

spades.awk

index 2ca0e376e7fbe7e975ca67d5a78defe5c1ccddff..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") {