mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
Fix juggle so it works for 3 players too.
This commit is contained in:
parent
77793e31b8
commit
b8a8c1c175
1 changed files with 3 additions and 3 deletions
|
@ -229,9 +229,10 @@ randIntArray( XP_U16* rnums, XP_U16 count )
|
|||
}
|
||||
|
||||
do {
|
||||
for ( i = 1; i < count; ++i ) {
|
||||
for ( i = count; i > 0 ; ) {
|
||||
XP_U16 rIndex = ((XP_U16)XP_RANDOM()) % i;
|
||||
XP_U16 tmp = rnums[rIndex];
|
||||
--i;
|
||||
rnums[rIndex] = rnums[i];
|
||||
rnums[i] = tmp;
|
||||
}
|
||||
|
@ -312,8 +313,7 @@ newg_juggle( NewGameCtx* ngc )
|
|||
(*ngc->getColProc)(closure, pos[0], col, deepCopy, &tmpValues[col] );
|
||||
}
|
||||
|
||||
cur = 0;
|
||||
while ( ++cur < nPlayers ) {
|
||||
for ( cur = 0; ++cur < nPlayers; ) {
|
||||
XP_LOGF( "%s: copying player %d to player %d", __FUNCTION__,
|
||||
pos[cur], pos[cur-1] );
|
||||
copyFromTo( ngc, pos[cur], pos[cur-1] );
|
||||
|
|
Loading…
Reference in a new issue