From 1ce0838714ea7db3fc3557cb79f1ad82d8bfd708 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Wed, 24 Jun 2009 21:56:37 -0700 Subject: [PATCH] display both foxes as playable, if the game doesn't allow schweinche, but the rules do in case you play with a single schweinchen (only the second one becomes highest trump), but the game doesn't allow schweinchen (e.g. queen solo), both foxes should be selectable, but only one was. Fixes issue #53 --- include/game.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/game.php b/include/game.php index f612b20..564c5c4 100644 --- a/include/game.php +++ b/include/game.php @@ -67,7 +67,7 @@ if( $gamestatus == 'pre' ) else { /* in a game Schweinchen is not valid in all types of games */ - if( $gametype == 'normal' || $gametype == 'silent' || $gametype=='trump' || $gametype=='wedding') + if( in_array($gametype,array('normal','wedding','trump','silent') )) if( in_array($RULES['schweinchen'],array('both','second','secondaftercall')) ) $ok=1; } @@ -1915,11 +1915,17 @@ switch($mystatus) * also check if we have both schweinchen, in that case only display on of them as playable */ if( ($followsuit && !same_type($card,$firstcard)) || - ( (int)($card)==19 && !$GAME['schweinchen-first'] && - ($RULES['schweinchen']=='second'|| - ( $RULES['schweinchen']=='secondaftercall' && - (DB_get_call_by_hash($GAME['schweinchen-who']) || DB_get_partner_call_by_hash($GAME['schweinchen-who']) ))) - && $GAME['schweinchen-who']==$me ) + ( (int)($card)==19 && + !$GAME['schweinchen-first'] && + ( $RULES['schweinchen']=='second' || + ( $RULES['schweinchen']=='secondaftercall' && + (DB_get_call_by_hash($GAME['schweinchen-who']) || + DB_get_partner_call_by_hash($GAME['schweinchen-who']) ) + ) + ) && + $GAME['schweinchen-who']==$me && + in_array($gametype,array('normal','wedding','trump','silent')) + ) ) display_card($card,$PREF['cardset']); else -- 2.17.1