From e709ea730c744f88053a93e6e47093e530d81e8e Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 9 Sep 2011 21:30:40 -0700 Subject: [PATCH] only exit exchange mode if user confirms trade --- xwords4/common/board.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 5bc71e17a..3859663fa 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -761,17 +761,15 @@ board_commitTurn( BoardCtxt* board ) TileBit traySelBits = pti->traySelBits; result = XP_TRUE; /* there's at least the window to clean up after */ - /* server_commitTrade() changes selPlayer, so board_endTrade - must be called first() */ if ( NO_TILES == traySelBits ) { util_userError( board->util, ERR_NO_EMPTY_TRADE ); - } else { + } else if ( util_userQuery( board->util, QUERY_COMMIT_TRADE, + (XWStreamCtxt*)NULL ) ) { + /* server_commitTrade() changes selPlayer, so board_endTrade + must be called first() */ (void)board_endTrade( board ); - if ( util_userQuery( board->util, QUERY_COMMIT_TRADE, - (XWStreamCtxt*)NULL ) ) { - (void)server_commitTrade( board->server, traySelBits ); - } + (void)server_commitTrade( board->server, traySelBits ); } } else { XP_Bool warn, legal;