From 2612fc848f5139ea1ba4dac784bba5780fa24914 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 20 Apr 2020 00:01:21 -0400 Subject: [PATCH] Euchre::Dealer: Fix hand-sorting post dealer_swap As an immediate followup to my previous test-adding commit, I realized what was wrong -- the hands only sorted on deal and on trump picking! On dealer_swap we need to resort the hands again (as the dealer's hand has changed). --- lib/Euchre/Dealer.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Euchre/Dealer.pm b/lib/Euchre/Dealer.pm index 8ac1e60..9278c59 100644 --- a/lib/Euchre/Dealer.pm +++ b/lib/Euchre/Dealer.pm @@ -451,6 +451,7 @@ sub dealer_swap { # Exchange the cards take_card($p, $msg->{card}) or return; push @{$p->{hand}}, $game->{trump_nominee}; + sort_hands($game); # Start the game $game->{phase} = 'play'; -- libgit2 1.1.1