X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2FObj%2Fbriskin5.phh;h=256d6e8e8f28cddd81c28a7d3e25adbc35dd8a4b;hb=5c514b65ef1f702724b213b5967d3a32d8525f0e;hp=eaa3096deb4bd50ff478bee914a8b8046792f6d5;hpb=ef7ec88c07a56a9ef3a24c63a7e64ddfcdc830ad;p=brisk.git diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index eaa3096..256d6e8 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -514,8 +514,8 @@ class Bin5_table extends Table { $pnts_sav = array(); - $this->old_act = $action; if ($action == BIN5_RULES_ALLPASS) { // return TRUE if all correct + $this->old_act = $action; $this->old_asta_win = -1; $this->old_pnt = 0; $this->mult_inc(1); @@ -528,6 +528,10 @@ class Bin5_table extends Table { $this->game_init(&$bri->user); } else if ($action == BIN5_RULES_ABANDON) { // return TRUE if all correct + if (!($user->handpt <= 2)) { + return (FALSE); + } + $this->old_act = $action; log_wr(sprintf("GIOCO FINITO !!!")); $this->old_asta_win = $user->table_pos; $this->old_pnt = 0; @@ -543,6 +547,7 @@ class Bin5_table extends Table { $this->game_init(&$bri->user); } else if ($action == BIN5_RULES_FINISH) { // return TRUE if all correct + $this->old_act = $action; do { $pro = 0; @@ -562,7 +567,7 @@ class Bin5_table extends Table { log_wr(sprintf("PRO: [%d]", $pro)); // PATTA case ! - if ($this->asta_pnt == 61 && $pro == 60) { + if (game_result($this->asta_pnt, $pro) == 0) { $this->points[$this->points_n % MAX_POINTS] = array(); for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $this->points[$this->points_n % MAX_POINTS][$i] = 0; @@ -570,6 +575,7 @@ class Bin5_table extends Table { } $this->points_n++; $this->old_pnt = $pro; + $this->old_asta_win = $this->asta_win; $this->mult_inc(1); break; @@ -1971,10 +1977,11 @@ function briscola_show($bri, $table, $user) function game_result($asta_pnt, $pnt) { + $sixtee = 60; if ($asta_pnt == 61) { - if ($pnt > 60) + if ($pnt > $sixtee) return (1); - else if ($pnt == 60) + else if ($pnt == $sixtee) return (0); else return (-1);