From b318bc82788a58362b39779c003e0e9083e6f901 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 20 Apr 2020 22:24:15 -0400 Subject: [PATCH] Euchre::Dealer: Fix loner reset_turn bug If in the second round of calling trump (i.e. no dealer_swap), we need to do the loner calculation before we reset_turn (otherwise the out_player could be the first person the play!). Kudos to ~wee for finding. --- lib/Euchre/Dealer.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Euchre/Dealer.pm b/lib/Euchre/Dealer.pm index 6ecd31d..799e99f 100644 --- a/lib/Euchre/Dealer.pm +++ b/lib/Euchre/Dealer.pm @@ -331,6 +331,11 @@ sub order { # Accept the vote... $game->{trump} = $msg->{vote}; $game->{caller} = $p->{seat}; + if ($msg->{loner}) { + my $partner_seat = ($p->{seat} + 2) % 4; + $game->{out_player} = $partner_seat; + $game->{tricks}->[$partner_seat] = 'X'; + } if ($game->{pass_count} < 4) { # Setting phase will block all other play actions until the # dealer is done swapping. Do still broadcast so dealer knows! @@ -344,11 +349,6 @@ sub order { reset_turn($game); } - if ($msg->{loner}) { - my $partner_seat = ($p->{seat} + 2) % 4; - $game->{out_player} = $partner_seat; - $game->{tricks}->[$partner_seat] = 'X'; - } sort_hands($game); broadcast_gamestate($game); } else { -- libgit2 1.1.1