From 271d5076af98eafe227eef872d8be63e57292a86 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 8 Jun 2008 11:13:14 -0700 Subject: [PATCH] BUGFIX: if a call is made the icon will show up right away check at the beginning if a call was made, so that the information is up to date when the output for the table is generated. Signed-off-by: Arun Persaud --- include/game.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/game.php b/include/game.php index 8d59103..0350d9e 100644 --- a/include/game.php +++ b/include/game.php @@ -118,6 +118,18 @@ if( $mystatus!='gameover' ) }; output_user_notes($myid,$gameid,$mystatus); +/* handle calls */ +if(myisset("call") && $_REQUEST["call"] == "120" && can_call(120,$me)) + $result = DB_query("UPDATE Hand SET point_call='120' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "90" && can_call(90,$me)) + $result = DB_query("UPDATE Hand SET point_call='90' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "60" && can_call(60,$me)) + $result = DB_query("UPDATE Hand SET point_call='60' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "30" && can_call(30,$me)) + $result = DB_query("UPDATE Hand SET point_call='30' WHERE hash='$me' "); +if(myisset("call") && $_REQUEST["call"] == "0" && can_call(0,$me)) + $result = DB_query("UPDATE Hand SET point_call='0' WHERE hash='$me' "); + /* output extra division in case this game is part of a session */ if($session) { @@ -1190,18 +1202,6 @@ switch($mystatus) /* update Game timestamp */ DB_update_game_timestamp($gameid); - /* check if a call was made, must do this before we set the card status to played */ - if(myisset("call") && $_REQUEST["call"] == "120" && can_call(120,$me)) - $result = DB_query("UPDATE Hand SET point_call='120' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "90" && can_call(90,$me)) - $result = DB_query("UPDATE Hand SET point_call='90' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "60" && can_call(60,$me)) - $result = DB_query("UPDATE Hand SET point_call='60' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "30" && can_call(30,$me)) - $result = DB_query("UPDATE Hand SET point_call='30' WHERE hash='$me' "); - if(myisset("call") && $_REQUEST["call"] == "0" && can_call(0,$me)) - $result = DB_query("UPDATE Hand SET point_call='0' WHERE hash='$me' "); - /* mark card as played */ DB_query("UPDATE Hand_Card SET played='true' WHERE hand_id='$handid' AND card_id=". DB_quote_smart($card)); -- 2.25.1