X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=spades.awk;h=fa79e88dd6d27654ec8e3cce7a63934ef08d7f1d;hb=7f222111278da0a210ba0078bef57ae2a0d5d531;hp=59fba1916c342fa73bb9b5832323c8d85b43163a;hpb=d09b51abe14c518c9e3d133100649774328247f8;p=~andy%2Frhawk diff --git a/spades.awk b/spades.awk index 59fba19..fa79e88 100644 --- a/spades.awk +++ b/spades.awk @@ -17,7 +17,7 @@ function sp_init(cards, tmp0, tmp1) function sp_reset(type) { # Per message - if (type >= 0) { + if (type < 0) { sp_from = "" # The speakers player name sp_valid = "" # It is the speaker turn } @@ -102,7 +102,8 @@ function sp_save(file, game) function sp_load(file, game) { # Load - json_load(file, game); + if (!json_load(file, game)) + return # Per hand sp_suit = game["suit"]; @@ -168,13 +169,13 @@ function sp_deal( shuf) say("Bidding starts with " sp_player "!") } -function sp_hand(who, sort, str) +function sp_hand(to, who, sort, str) { asorti(sp_hands[who], sort, "sp_csort") for (i=0; i