From: Arun Persaud Date: Sun, 18 May 2008 18:48:25 +0000 (-0700) Subject: BUGFIX: show schweinchen has highest trump in your hand X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=a4149c6703653b2d0d5f3da4277d7fe065048edd BUGFIX: show schweinchen has highest trump in your hand correctly shows both schweinchen as highest trump or just one depending on the rules. If only one don't allow to play it unless the first fox has been played. Signed-off-by: Arun Persaud --- diff --git a/include/functions.php b/include/functions.php index bbffe00..5267bfb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,5 +1,5 @@ \n \n"; function cmp($a,$b) { @@ -942,7 +975,7 @@ function generate_global_score_table() $a=$a['points']/$a['nr']; $b=$b['points']/$b['nr']; - if ($a == $b) + if ($a == $b) return 0; return ($a > $b) ? -1 : 1; } @@ -953,7 +986,7 @@ function generate_global_score_table() echo " ",$pl['name'],"",round($pl['points']/$pl['nr'],3),"\n"; } echo "\n"; - + return; } diff --git a/include/game.php b/include/game.php index 668aa1f..0ec52e2 100644 --- a/include/game.php +++ b/include/game.php @@ -96,6 +96,8 @@ else } /* end check for Schweinchen */ +set_gametype($gametype); /* this sets the $CARDS variable */ + /* put everyting in a form */ echo "
\n"; @@ -211,7 +213,7 @@ switch($mystatus) case 'init': /* here we ask the player if he is sick */ $mycards = DB_get_hand($me); - sort($mycards); + $mycards = mysort($mycards,$gametype); /* output sickness of other playes, in case the already selected and are sitting in front of the current player */ echo "\n
    \n"; @@ -333,7 +335,7 @@ switch($mystatus) if($mystatus=='check') { $mycards = DB_get_hand($me); - sort($mycards); + $mycards = mysort($mycards,$gametype); /* output sickness of other playes, in case the already selected and are sitting in front of the current player */ echo "\n
      \n"; @@ -1722,7 +1724,10 @@ switch($mystatus) foreach($mycards as $card) { - if($followsuit && !same_type($card,$firstcard)) + if( ($followsuit && !same_type($card,$firstcard)) || + ( (int)($card)==19 && ($RULES['schweinchen']=='second'||$RULES['schweinchen']=='secondaftercall') + && $GAME['schweinchen-who']==$me && !$GAME['schweinchen-first'] ) + ) display_card($card,$PREF["cardset"]); else display_link_card($card,$PREF["cardset"]);