BUGFIX: a comment for schweinchen was issued even in solo games without schweinchen
authorArun Persaud <arun@nubati.net>
Sat, 29 Mar 2008 17:45:59 +0000 (10:45 -0700)
committerArun Persaud <arun@nubati.net>
Sat, 29 Mar 2008 17:53:04 +0000 (10:53 -0700)
fixed the comment issue and also added trump solo to games where schweinchen will count

Signed-off-by: Arun Persaud <arun@nubati.net>
functions.php
index.php

index 5adf4fa274627652b5ff01e620a02c93289a5c04..d083593abfcb3117be7fc82f75eac138dff7925b 100644 (file)
@@ -157,11 +157,12 @@ function compare_cards($a,$b,$game)
   if( $b/2 - (int)($b/2) != 0.5)
     $b--;
 
-  /* some special cases */
+  /* check for schweinchen and ten of hearts*/
   switch($game)
     {
     case "normal":
     case "silent":
+    case "trump":
       if($RULES["schweinchen"]=="both" && $GAME["schweinchen"])
        {
          if($a == 19 || $a == 20 )
@@ -176,13 +177,17 @@ function compare_cards($a,$b,$game)
          if($b == 19 || $b == 20 )
            return 0;
        };
-    case "trump":
     case "heart":
     case "spade":
     case "club":
+      /* check for ten of hearts rule */
       if($RULES["dullen"]=="secondwins")
        if($a==1 && $b==1) /* both 10 of hearts */
          return 0;        /* second one wins.*/
+    case "trumpless":
+    case "jack":
+    case "queen":
+      /* no special cases here */
     }
 
   /* normal case */
index f212cf307096cd44c0c8d306de85c00ad5268958..0f94dcf6c6b2d2eac9f1d56d96eb49cc8cb5f505 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1381,8 +1381,12 @@ else if(myisset("me"))
 
              $playid = DB_play_card($trickid,$handcardid,$sequence);
 
-             /* check for schweinchen */
-             if($GAME["schweinchen"] && ($card == 19 || $card == 20) )
+             /* check special output for schweinchen in case: 
+              * schweinchen is in the rules, a fox has been played and the gametype is correct
+              */
+             if( $GAME["schweinchen"] && 
+                 ($card == 19 || $card == 20) && 
+                 ($gametype == "normal" || $gametype == "silent"|| $gametype=="trump"))
                {
                  $GAME["schweinchen"]++; // count how many have been played including this one
                  if($GAME["schweinchen"]==3 && $RULES["schweinchen"]=="second" )