[Kde-games-devel] Review Request 127171: KBlocks: Fix unplayable game when changing difficulty
Julian Helfferich
julian.helfferich at googlemail.com
Sun Feb 28 21:00:10 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127171/
-----------------------------------------------------------
(Updated Feb. 28, 2016, 9 p.m.)
Status
------
This change has been marked as submitted.
Review request for KDE Games.
Changes
-------
Submitted with commit 145820a70ce12409873e9326c8c232a790c76081 by Julian Helfferich to branch Applications/15.12.
Bugs: 339038
http://bugs.kde.org/show_bug.cgi?id=339038
Repository: kblocks
Description
-------
This patch fixes bug #339038.
When the difficulty is changed before a game is started, pressing keys on the keyboard does not have any effect, rendering the game unplayable.
The reason is that KBlocksWin::levelChanged() calls KBlocksWin::startGame(). However, no player has yet been added to the KBlocksPlayManager.
Now, KBlocksWin::levelChanged() calls either KBlocksWin::singleGame() or KBlocksWin::pveStepGame(). These functions are also called when the "Single Game" button is pressed or the "Human vs. AI" menu is selected, respectively.
To determine whether to start "Single game" or "Human vs AI", the current game type is stored in a new variable. Thus, changing the difficulty always starts the currently running or just finished game type.
Diffs
-----
KBlocksWin.cpp ca8139e
Diff: https://git.reviewboard.kde.org/r/127171/diff/
Testing
-------
1) Started a first game
2) Restarted a running game
3) Restarted a finished game
each by either
A) Changing the difficulty
B) Pressing the "Single Game" button
C) Selecting "Human vs AI" from the menu
Thanks,
Julian Helfferich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20160228/9c9b6741/attachment.html>
More information about the kde-games-devel
mailing list