X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=db7ccadb059a747f422dd7481f74151b341ae41f;hp=9f58f51f969fb610a024637213c5ff9cdd726d5a;hb=ec0599c27c8cd38cfc7e9939d753b2d9a262db00;hpb=671da1a387eb879aec526ea9b7614ff9381e7c0f
diff --git a/include/functions.php b/include/functions.php
index 9f58f51..db7ccad 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -177,14 +177,27 @@ function compare_cards($a,$b,$game)
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
- if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
+ }
+ else if($RULES['schweinchen']=='second' && $GAME['schweinchen-second'])
{
if($a == 19 || $a == 20 )
return 1;
if($b == 19 || $b == 20 )
return 0;
- };
+ }
+ else if($RULES['schweinchen']=='secondaftercall' && $GAME['schweinchen-who'] && $GAME['schweinchen-second'] )
+ {
+ /* check if a call was made either by the player or his partner. If so activate Schweinchen rule. */
+ if(DB_get_call_by_hash($GAME['schweinchen-who']) || DB_get_partner_call_by_hash($GAME['schweinchen-who']) )
+ {
+ if($a == 19 || $a == 20 )
+ return 1;
+ if($b == 19 || $b == 20 )
+ return 0;
+ }
+ /* if not, do nothing and the foxes are just handeled as normal trump */
+ }
+ ;
case "heart":
case "spade":
case "club":
@@ -734,7 +747,7 @@ function display_table ()
if(!$debug)
echo " $name \n";
else
- echo " $name\n";
+ echo " $name\n";
/* add hints for poverty, wedding, solo, etc */
if( $gametype != "solo")
@@ -844,27 +857,29 @@ function display_table ()
}
-function display_user_menu()
+function display_user_menu($id)
{
- global $WIKI,$myid,$INDEX;
+ global $WIKI,$INDEX;
$result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand".
" LEFT JOIN Game On Hand.game_id=Game.id".
- " WHERE Hand.user_id='$myid'".
- " AND Game.player='$myid'".
+ " WHERE Hand.user_id='$id'".
+ " AND ( Game.player='$id' OR ISNULL(Game.player) )".
" AND Game.status<>'gameover'".
" ORDER BY Game.session" );
- if(DB_num_rows($result))
- echo "It's your turn in these games:
\n";
$i=0;
while( $r = DB_fetch_array($result))
{
if($i==0)
- echo "