[Kde-games-devel] Review Request 127171: KBlocks: Fix unplayable game when changing difficulty

Julian Helfferich julian.helfferich at googlemail.com
Fri Feb 26 19:08:39 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127171/
-----------------------------------------------------------

(Updated Feb. 26, 2016, 7:08 p.m.)


Review request for KDE Games.


Changes
-------

I have realized, that the bug can be fixed in an even simpler way, utilizing an already existing variable instead of creating a new one.


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 (updated)
-----

  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/20160226/9db2e0a8/attachment.html>


More information about the kde-games-devel mailing list