BUGFIX: if you win a trick, you don't have to reload the page from now on.
authorArun Persaud <arun@nubati.net>
Mon, 20 Feb 2012 07:31:09 +0000 (23:31 -0800)
committerArun Persaud <apersaud@lbl.gov>
Mon, 20 Feb 2012 07:31:09 +0000 (23:31 -0800)
added a check if the player won the trick, if so, show radiobuttons next to cards to select new one.
Also needed to unset firstcard when winning the trick, since without it follow suite was still working with regards to the first card in the last trick.

include/game.php

index 0ce72e55a1f9e583245b6781ca2b77a42df5549e..278a52c60a2c86e52babfe278f070fd4bd5b643a 100644 (file)
@@ -1681,6 +1681,7 @@ switch($mystatus)
 
                /* who is the next player? */
                $next = $winner;
+               $firstcard = ''; /* unset firstcard, so followsuit doesn't trigger with the last trick */
              }
            else
              {
@@ -2070,7 +2071,8 @@ switch($mystatus)
 
     echo "</div>\n"; /* end ul tricks*/
 
-    if($myturn && !myisset('card') && $mystatus=='play' )
+    if(   ($myturn && !myisset('card') && $mystatus=='play') /* it's my turn*/
+         || ($myturn && myisset('card') && $next==$mypos && $mystatus=='play')  /* a card has been played and player won the trick*/)
       {
        $card_status = CARDS_MYTURN;
       }