Version: 0.4.0 (using KDE 3.4.1, Gentoo) Compiler: gcc version 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) OS: Linux (i686) release 2.6.12-gentoo-r6 The number of enemy balls that appear in the level does not change not matter what it is set to. For example, when set to be 0, 1, 2, or 13, 1 (one) ball appears.
The original bug report was inaccurate. You must exit and restart the game for the changed number of balls to take effect. This is not the case for the number of enemy snakes.
Created attachment 14248 [details] simple rewrite of Rattler::setBalls Attached patch is just a rewrite of Rattler::setBalls to work more like Rattler::setComputerSnakes. I've done some minimal testing, and it seems to work fine.
Sorry, the patch is for 3.5 branch (I haven't got a KDE4 install working yet).
SVN commit 499007 by aacid: Apply a patch to fix bug 111916 inspired in one by Henry Malthus. I've applied mine becasue changes the code less heaviliy. Thanks for reporting BUGS: 111916 M +7 -9 rattler.cpp --- branches/KDE/3.5/kdegames/ksnake/rattler.cpp #499006:499007 @@ -589,25 +589,23 @@ } } -void Rattler::setBalls(int numBalls) +void Rattler::setBalls(int newNumBalls) { - int count = balls->count(); + numBalls = balls->count(); - if (!gameState.testBit(Playing) || - !gameState.testBit(Demo) || - numBalls == count) + if (!(gameState.testBit(Playing) || gameState.testBit(Demo)) || numBalls == newNumBalls) return; - while ( numBalls > count) { + while ( newNumBalls > numBalls) { Ball *b = new Ball(board, pix); balls->append(b); - numBalls--; + numBalls++; } - while (numBalls < count) { + while (newNumBalls < numBalls) { Ball *b = balls->getLast(); b->zero(); balls->removeLast(); - numBalls++; + numBalls--; } }