mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
on commandline, only allow assignment of per-player dicts to local
players. I don't know what happens when a player's position is changed when its game is a guest and the hosts rearranges players. Which is why on Android I'm moving to allowing per-player dicts only on local-only games.
This commit is contained in:
parent
25a1ee451b
commit
4cf595e939
1 changed files with 17 additions and 6 deletions
|
@ -1929,12 +1929,23 @@ main( int argc, char** argv )
|
|||
mainParams.needsNewGame = XP_TRUE;
|
||||
}
|
||||
|
||||
for ( ii = 0; ii < nPlayerDicts; ++ii ) {
|
||||
const XP_UCHAR* name = mainParams.playerDictNames[ii];
|
||||
if ( !!name ) {
|
||||
mainParams.dicts.dicts[ii] =
|
||||
linux_dictionary_make( MPPARM(mainParams.util->mpool)
|
||||
&mainParams, name, mainParams.useMmap );
|
||||
/* per-player dicts are for local players only. Assign in the order
|
||||
given. It's an error to give too many, or not to give enough if
|
||||
there's no game-dict */
|
||||
if ( 0 < nPlayerDicts ) {
|
||||
XP_U16 nextDict = 0;
|
||||
for ( ii = 0; ii < mainParams.gi.nPlayers; ++ii ) {
|
||||
if ( mainParams.gi.players[ii].isLocal ) {
|
||||
const XP_UCHAR* name = mainParams.playerDictNames[nextDict++];
|
||||
XP_ASSERT( !!name );
|
||||
mainParams.dicts.dicts[ii] =
|
||||
linux_dictionary_make( MPPARM(mainParams.util->mpool)
|
||||
&mainParams, name, mainParams.useMmap );
|
||||
}
|
||||
}
|
||||
if ( nextDict < nPlayerDicts ) {
|
||||
usage( argv[0], " --player-dict used more times than there are "
|
||||
"local players" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue