BUGFIX: adding a new game had a bug in the INSERT statement; wedding offset in can_ca...
authorarun <arun@nubati.net>
Tue, 12 Jun 2007 11:37:28 +0000 (11:37 +0000)
committerarun <arun>
Tue, 12 Jun 2007 11:37:28 +0000 (11:37 +0000)
functions.php
index.php

index 997ba43e154af02582aa59ff981015d2e85628fa..f6dc31dcf1b88de0825966afb0c847b4dc809b6b 100644 (file)
@@ -677,7 +677,7 @@ function can_call($what,$hash)
   switch ($RULES["call"])
     {
     case "1st-own-card":
   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":
        return 1;
       break;
     case "5th-card":
index a2cf35b0cd2f38a1085e1088c5d6fa258ab5e530..291d93097e1699c1165eb543d16205c8400ef2aa 100644 (file)
--- a/index.php
+++ b/index.php
@@ -94,7 +94,7 @@ if(myisset("new"))
        $ruleset = DB_get_ruleset_by_gameid($followup); /* just copy ruleset from old game, 
                                                         this way no manipulation is possible */
        if($session)
        $ruleset = DB_get_ruleset_by_gameid($followup); /* just copy ruleset from old game, 
                                                         this way no manipulation is possible */
        if($session)
-         mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre',".
+         mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre',".
                      "'$ruleset','$session' ,NULL)");
        else
          {
                      "'$ruleset','$session' ,NULL)");
        else
          {
@@ -102,12 +102,12 @@ if(myisset("new"))
            $max = DB_get_max_session();
            $max++;
            mysql_query("UPDATE Game SET session='".$max."' WHERE id=".DB_quote_smart($followup));
            $max = DB_get_max_session();
            $max++;
            mysql_query("UPDATE Game SET session='".$max."' WHERE id=".DB_quote_smart($followup));
-           mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre',".
+           mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre',".
                        "'$ruleset','$max' ,NULL)");
          }
       }
     else
                        "'$ruleset','$max' ,NULL)");
          }
       }
     else
-      mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','pre', ".
+      mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1','1','pre', ".
                  "'$ruleset',NULL ,NULL)");
     $game_id = mysql_insert_id();
     
                  "'$ruleset',NULL ,NULL)");
     $game_id = mysql_insert_id();