From 5084e70843666692906980a834b3f9c39912529c Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 5 Feb 2016 07:29:51 -0800 Subject: [PATCH] fix bug: if you're iterating through hints and you drag a tile to the left of tray divider (without moving divider) it may still be included in hinted moves. Fix is to reset engine whenever the set of tiles left of divider changes. --- xwords4/common/board.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index c4199dab2..df6f95d32 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -3725,6 +3725,14 @@ boardTilesChanged( void* p_board, XP_U16 turn, XP_S16 index1, XP_S16 index2 ) BoardCtxt* board = (BoardCtxt*)p_board; if ( turn == board->selPlayer ) { invalTrayTilesBetween( board, index1, index2 ); + + /* If we're changing the set of ignored tiles, reset the engine */ + XP_U16 divLoc = model_getDividerLoc( board->model, turn ); + if ( index1 < divLoc && index2 < divLoc ) { + /* both below; no need to reset */ + } else if ( index1 < divLoc || index2 < divLoc ) { + board_resetEngine( board ); + } } } /* boardTilesChanged */