only exit exchange mode if user confirms trade

This commit is contained in:
Andy2 2011-09-09 21:30:40 -07:00
parent c9c498786e
commit e709ea730c

View file

@ -761,17 +761,15 @@ board_commitTurn( BoardCtxt* board )
TileBit traySelBits = pti->traySelBits; TileBit traySelBits = pti->traySelBits;
result = XP_TRUE; /* there's at least the window to clean up result = XP_TRUE; /* there's at least the window to clean up
after */ after */
/* server_commitTrade() changes selPlayer, so board_endTrade
must be called first() */
if ( NO_TILES == traySelBits ) { if ( NO_TILES == traySelBits ) {
util_userError( board->util, ERR_NO_EMPTY_TRADE ); 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 ); (void)board_endTrade( board );
if ( util_userQuery( board->util, QUERY_COMMIT_TRADE, (void)server_commitTrade( board->server, traySelBits );
(XWStreamCtxt*)NULL ) ) {
(void)server_commitTrade( board->server, traySelBits );
}
} }
} else { } else {
XP_Bool warn, legal; XP_Bool warn, legal;