summaryrefslogtreecommitdiffstats
path: root/include/game.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-05-18 10:31:34 -0700
committerArun Persaud <arun@nubati.net>2008-05-18 10:31:34 -0700
commitf922adf616e3a3effca51f85edfdbc11eef91799 (patch)
tree9430ba926813e9684d390f53aabd3f8fd1cc01d1 /include/game.php
parente19f27d6e8d5dfa770037fec391ffc22ee7ca259 (diff)
downloade-DoKo-f922adf616e3a3effca51f85edfdbc11eef91799.tar.gz
e-DoKo-f922adf616e3a3effca51f85edfdbc11eef91799.tar.bz2
e-DoKo-f922adf616e3a3effca51f85edfdbc11eef91799.zip
BUGFIX: show comment for Schweinchen the moment it is played
the user had to reload before he could see the comment, now the automated comment shows up right away. Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'include/game.php')
-rw-r--r--include/game.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/game.php b/include/game.php
index 3191793..b41ca26 100644
--- a/include/game.php
+++ b/include/game.php
@@ -57,9 +57,9 @@ if($gametype=="solo")
$GT = $gametype." ".$GT;
}
-/* do we need to worry about Schweinchen?
+/* do we need to worry about Schweinchen?
* check gametype and rules
- * if yes, figure out if someone actually has Schweinchen
+ * if yes, figure out if someone actually has Schweinchen
* save information in $GAME
*/
$ok=0;
@@ -67,7 +67,7 @@ if( $gametype == 'normal' || $gametype == 'silent' || $gametype=='trump' )
if( in_array($RULES['schweinchen'],array('both','second','secondaftercall')) )
$ok=1;
-if($ok)
+if($ok)
{
/* need to check for Schweinchen */
for($i=1;$i<5;$i++)
@@ -1164,10 +1164,11 @@ switch($mystatus)
else
$GAME['schweinchen-second'] = 1; /* this must be the second fox */
- if($GAME['schweinchen-second']==1 && $RULES['schweinchen']=='second' )
- DB_insert_comment("Schweinchen! ",$playid,$myid);
- if($RULES['schweinchen']=='both' )
- DB_insert_comment("Schweinchen! ",$playid,$myid);
+ if( ($GAME['schweinchen-second']==1 && $RULES['schweinchen']=='second') || $RULES['schweinchen']=='both')
+ {
+ DB_insert_comment("Schweinchen! ",$playid,$myid);
+ $commentSchweinchen = "Schweinchen! ";
+ }
if ($debug)
echo "schweinchen = ".$GAME["schweinchen-who"]." ---<br />";
}
@@ -1310,6 +1311,8 @@ switch($mystatus)
$comment = $_REQUEST["comment"];
if($comment != "")
DB_insert_comment($comment,$playid,$myid);
+ if($commentSchweinchen)
+ $comment = $commentSchweinchen . $comment;
};
/* check for note */