diff options
author | Arun Persaud <arun@nubati.net> | 2009-05-11 21:58:25 -0700 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2009-05-11 22:02:45 -0700 |
commit | 0a4212f2c7179913c6ae87011b8f00d435af93e3 (patch) | |
tree | 0f34e8c645575ee8715f085f2960416ee9a72758 /include/output.php | |
parent | 268859f56cb8f19b65eca8550dd6a71b6d475971 (diff) | |
download | e-DoKo-0a4212f2c7179913c6ae87011b8f00d435af93e3.tar.gz e-DoKo-0a4212f2c7179913c6ae87011b8f00d435af93e3.tar.bz2 e-DoKo-0a4212f2c7179913c6ae87011b8f00d435af93e3.zip |
BUGFIX: wrongly displayed "trump back" in pre-trick during poverty
displayed it when the person with not enough trump gave trump to his partner, which is almost always the case.
Diffstat (limited to 'include/output.php')
-rw-r--r-- | include/output.php | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/include/output.php b/include/output.php index c2611ba..161ef3a 100644 --- a/include/output.php +++ b/include/output.php @@ -522,7 +522,7 @@ function output_exchanged_cards() * go through all positions, check that position has cards that need to be shown and * show those cards */ - $show = 1; + $show=1; for($mypos=1;$mypos<5;$mypos++) { $usersick = DB_get_sickness_by_pos_and_gameid($mypos,$gameid); @@ -530,22 +530,45 @@ function output_exchanged_cards() $mypos==$povertypos1 || $mypos==$partnerpos1 || $mypos==$povertypos2 || $mypos==$partnerpos2 ) { + /* figure out if we gave trump back */ + $trump_back1=0; + if($povertypos2) + foreach($povertycards1 as $card) + { + if(is_trump($card)) + { + $trump_back1=1; + break; + } + } + $trump_back2=0; + if($povertypos2) + foreach($povertycards2 as $card) + { + if(is_trump($card)) + { + $trump_back2=1; + break; + } + } + + /* output vorbehalt */ echo " <div class=\"vorbehalt".($mypos-1)."\"> Vorbehalt <br />\n"; if($show) echo " $usersick <br />\n"; + + /* output cards */ if($mypos==$partnerpos1) { - $trump_back=0; foreach($partnercards1 as $card) { - if(is_trump($card)) $trump_back=1; echo ' '; if($povertyhash1 == $me || $partnerhash1 == $me || $mystatus=='gameover') display_card($card,$PREF['cardset']); else display_card(0,$PREF['cardset']); } - if($trump_back) echo "Trump back"; + if($trump_back1) echo " Trump back"; } else if($mypos==$povertypos1) { @@ -557,6 +580,7 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } + if($trump_back1) echo " Trump back"; } else if($mypos==$povertypos2) { @@ -568,10 +592,10 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } + if($trump_back2) echo " Trump back"; } else if($mypos==$partnerpos2) { - $trump_back=0; foreach($partnercards2 as $card) { if(is_trump($card)) $trump_back=1; @@ -581,13 +605,12 @@ function output_exchanged_cards() else display_card(0,$PREF['cardset']); } - if($trump_back) echo "Trump back"; + if($trump_back2) echo " Trump back"; } echo " </div>\n"; - - if($mygametype == $usersick) - $show = 0; } + if($mygametype == $usersick) + $show = 0; } } |