BUGFIX: adding a new game had a bug in the INSERT statement; wedding offset in can_ca...
[e-DoKo.git] / functions.php
index 418591dd2d04537a3cb9582a9ee3e745f5871fa8..f6dc31dcf1b88de0825966afb0c847b4dc809b6b 100644 (file)
@@ -656,7 +656,7 @@ function can_call($what,$hash)
   $gameid   = DB_get_gameid_by_hash($hash);
   $gametype = DB_get_gametype_by_gameid($gameid);
 
-  $NRcards  = count(DB_get_hand($me));
+  $NRcards  = count(DB_get_hand($hash));
   
   $NRallcards = 0;
   for ($i=1;$i<5;$i++)
@@ -677,11 +677,11 @@ function can_call($what,$hash)
   switch ($RULES["call"])
     {
     case "1st-own-card":
-      if( 4-($what/30) >= 12 - $NRcards + $offset)
+      if( 4-($what/30) >= 12 - ($NRcards + $offset))
        return 1;
       break;
     case "5th-card":
-      if( 27+4*($what/30)) <= $NRallcards + $offset*4)
+      if( 27+4*($what/30) <= $NRallcards + $offset*4)
        return 1;
       break;
     case "9-cards":