Bug 342165 - Demo leaves redoable moves in new game
Summary: Demo leaves redoable moves in new game
Status: RESOLVED FIXED
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: 0.8
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-23 17:00 UTC by Jan-Peter Nilsson
Modified: 2016-01-04 00:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Initialize GameData allow_undo and allow_redo from constructor (1.59 KB, patch)
2014-12-23 23:42 UTC, Jan-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Peter Nilsson 2014-12-23 17:00:09 UTC
Aborting a demo by clicking on the game board creates a new game but does not set the redo state, which makes redo available even though there is nothing to redo.

Clicking redo at this point does not appear to do anything except updating the removed tiles counter and making undo available, clicking undo will create an empty tile on the top left corner of the game board.

Reproducible: Always

Steps to Reproduce:
1. Select Demo in the Move menu
2. Click anywhere on the game board to abort the demo

Actual Results:  
A new game is created with undo available.

Expected Results:  
Undo should not be available until after the first move
Comment 1 Jan-Peter Nilsson 2014-12-23 23:42:56 UTC
Created attachment 90105 [details]
Initialize GameData allow_undo and allow_redo from constructor

The problem is that allow_redo (and allow_undo and) are not initialized by the GameData constructor, so if we create a new instance without setting it we don't know what we will get.
Comment 2 Frederik Schwarzer 2016-01-04 00:46:38 UTC
This appeasr to be fixed in current master branch.

Please test the master version and ropen this in case it is not fixed properly.