mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
Fix crasher: don't start a board-scroll operation and attempt to end
by dropping a tile. (This part is to detect that no drag actuall happened.)
This commit is contained in:
parent
087a05dd6a
commit
0b5ad41899
2 changed files with 7 additions and 4 deletions
|
@ -1054,10 +1054,11 @@ model_moveBoardToTray( ModelCtxt* model, XP_S16 turn,
|
||||||
}
|
}
|
||||||
} /* model_moveBoardToTray */
|
} /* model_moveBoardToTray */
|
||||||
|
|
||||||
void
|
XP_Bool
|
||||||
model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
||||||
XP_U16 rowCur, XP_U16 colNew, XP_U16 rowNew )
|
XP_U16 rowCur, XP_U16 colNew, XP_U16 rowNew )
|
||||||
{
|
{
|
||||||
|
XP_Bool found = XP_FALSE;
|
||||||
PlayerCtxt* player = &model->players[turn];
|
PlayerCtxt* player = &model->players[turn];
|
||||||
XP_S16 index = player->nPending;
|
XP_S16 index = player->nPending;
|
||||||
|
|
||||||
|
@ -1079,10 +1080,12 @@ model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
||||||
incrPendingTileCountAt( model, colNew, rowNew );
|
incrPendingTileCountAt( model, colNew, rowNew );
|
||||||
|
|
||||||
invalidateScore( model, turn );
|
invalidateScore( model, turn );
|
||||||
|
found = XP_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return found;
|
||||||
|
} /* model_moveTileOnBoard */
|
||||||
|
|
||||||
void
|
void
|
||||||
model_resetCurrentTurn( ModelCtxt* model, XP_S16 whose )
|
model_resetCurrentTurn( ModelCtxt* model, XP_S16 whose )
|
||||||
|
|
|
@ -140,7 +140,7 @@ void model_moveBoardToTray( ModelCtxt* model, XP_S16 turn,
|
||||||
XP_U16 col, XP_U16 row, XP_U16 trayOffset );
|
XP_U16 col, XP_U16 row, XP_U16 trayOffset );
|
||||||
void model_moveTrayToBoard( ModelCtxt* model, XP_S16 turn, XP_U16 col,
|
void model_moveTrayToBoard( ModelCtxt* model, XP_S16 turn, XP_U16 col,
|
||||||
XP_U16 row, XP_S16 tileIndex, Tile blankFace );
|
XP_U16 row, XP_S16 tileIndex, Tile blankFace );
|
||||||
void model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
XP_Bool model_moveTileOnBoard( ModelCtxt* model, XP_S16 turn, XP_U16 colCur,
|
||||||
XP_U16 rowCur, XP_U16 colNew, XP_U16 rowNew );
|
XP_U16 rowCur, XP_U16 colNew, XP_U16 rowNew );
|
||||||
|
|
||||||
XP_S16 model_trayContains( ModelCtxt* model, XP_S16 turn, Tile tile );
|
XP_S16 model_trayContains( ModelCtxt* model, XP_S16 turn, Tile tile );
|
||||||
|
|
Loading…
Add table
Reference in a new issue