From f0e93ad1feb9ba47dc1db80354b5f28d29b5ab27 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 4 Mar 2010 19:11:18 -0800 Subject: [PATCH] BUGFIX: show "It's your turn in these games" menu also when you played the last card in a game When showing the menu we test for the status the user had before he played the card. This fixes Issue #35. --- include/game.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/game.php b/include/game.php index a1c02a0..93ab461 100644 --- a/include/game.php +++ b/include/game.php @@ -47,6 +47,7 @@ global $GAME,$RULES,$CARDS; $gameid = DB_get_gameid_by_hash($me); $myname = DB_get_name('hash',$me); $mystatus = DB_get_status_by_hash($me); +$origmystatus = DB_get_status_by_hash($me); /* to show "it's your turn" menu when game has just finished */ $mypos = DB_get_pos_by_hash($me); $myhand = DB_get_handid('hash',$me); $myparty = DB_get_party_by_hash($me); @@ -2031,11 +2032,20 @@ switch($mystatus) /* output other games where it is the users turn * make sure that the people looking at old games don't see the wrong games here */ -if( $mystatus != 'gameover' ) - display_user_menu($myid); +if( $gamestatus != 'gameover' ) + { + /* game isn't over, only valid user can get here, so show menu */ + display_user_menu($myid); + } +else if( $origmystatus != 'gameover' ) + { + /* user just played the very last card, game is now over, it's still ok to show the menu though */ + display_user_menu($myid); + } else if( $mystatus == 'gameover' && - isset($_SESSION['id']) ) + isset($_SESSION['id']) ) { + /* user is looking at someone else's game, show the menu for the correct user */ display_user_menu($_SESSION['id']); } else -- 2.17.1