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

Julian Helfferich julian.helfferich at googlemail.com
Thu Feb 25 20:58:42 UTC 2016


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

Review request for KDE Games.


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.h c07d5d3 
  KBlocksWin.cpp 24c4b54 

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/20160225/6e2ed901/attachment.html>


More information about the kde-games-devel mailing list