From: Arun Persaud Date: Wed, 7 May 2008 02:10:21 +0000 (-0700) Subject: BUGFIX: typo in scoring algorithm X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=a0f87f33ef571a47b143ae06530b64c8496f2f6e;ds=sidebyside BUGFIX: typo in scoring algorithm The re-party got less points in case the contra-party made a call and lost the game. Signed-off-by: Arun Persaud --- diff --git a/include/game.php b/include/game.php index b2c4fb0..cfb2b55 100644 --- a/include/game.php +++ b/include/game.php @@ -1,5 +1,5 @@ 120) - $winning_party="re"; - else - $winning_party="contra"; + { + /* nobody made a call, so it's easy to figure out who won */ + if($re>120) + $winning_party="re"; + else + $winning_party="contra"; + } else { + /* if one party makes a call, they only win, iff they make enough points + * if only one party made a call, the other one wins, + * if the first one didn't make it + */ if($call_re) { $offset = 120 - $call_re; @@ -1361,7 +1368,7 @@ switch($mystatus) if($re > 120+$offset) $winning_party="re"; - else if ( $call_contra == NULL ) + else if ($call_contra == NULL ) $winning_party="contra"; } @@ -1373,7 +1380,7 @@ switch($mystatus) if($contra > 120+$offset) $winning_party="contra"; - else if ( $call_contra == NULL ) + else if ($call_re == NULL ) $winning_party="re"; } } @@ -1514,7 +1521,7 @@ switch($mystatus) $score = implode("\n",$score); $score = $header.$score; - + $message .= "Score Table:\n"; $message .= $score; @@ -1586,7 +1593,7 @@ switch($mystatus) echo "$note
\n"; echo "Insert note:\n"; echo " \n"; - + $mycards = DB_get_hand($me); $mycards = mysort($mycards,$gametype); echo "
\n";