Bug 333694

Summary: Columns of invisible blocks after one block reached the top of the playing field.
Product: [Applications] kblocks Reporter: Julian Helfferich <julian.helfferich>
Component: generalAssignee: Zhongjie Cai <squall.leonhart.cai>
Status: RESOLVED FIXED    
Severity: normal CC: gee_jay_, kde-games-bugs
Priority: NOR    
Version: 0.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Julian Helfferich 2014-04-21 17:34:32 UTC
This bug appears when blocks are stacked high enough to fill the playing field up to the top. If lines are removed afterwards, the blocks drop as expected. Where blocks touched the top of the playing field, however, the appearing free space is filled with invisible blocks.

These invisible blocks behave as normal blocks, i.e. dropping blocks can not be moved through invisible blocks and lines containing invisible blocks can be removed.

This bug has been reported on the kde-games-devel mailing list [1]. I am able to reproduce the bug using the latest git version (ID 7b1a51d100410b7a31311d5003adccb32836ea85).

Best regards,
Julian

[1] http://lists.kde.org/?l=kde-games-devel&m=139309126516522&w=2

Reproducible: Always

Steps to Reproduce:
1. Start a new game.
2. Stack blocks up to the topmost layer. For the sake of simplicity, I use the rightmost column.
3. Fill several lines to remove them from the game.
4. Try to move a block to a column where previously a block touched the top of the playing field.
Actual Results:  
The columns are inaccessible. In other words, they are filled with invisible blocks.

Expected Results:  
This part of the playing field should be empty and accessible.
Comment 1 GJ 2014-05-29 10:37:58 UTC
I noticed this behavior too.

The following patch solves it somehow but you might get half figures.
So it isn't 100% OK but me and my addiction can live with it.

>---------------------------------------------------------------<
--- kblocks/KBlocksField.cpp 2014-02-22 18:05:27.533871295 +0100
+++ kblocks-patched/KBlocksField.cpp 2014-02-22 18:07:54.743875286 +0100
@@ -138,6 +138,12 @@
             maBoard[i][j] = maBoard[i-1][j];
         }
     }
+
+    for(int j = 0; j < mWidth; j++)
+    {
+        maBoard[0][j] = false;
+    }
+
     mCurModifyID += 1;
}
>---------------------------------------------------------------<
Comment 2 Julian Helfferich 2015-10-25 02:21:47 UTC
Git commit 65a1b8136535758c77f66b505255206fd13f3117 by Julian Helfferich.
Committed on 25/10/2015 at 02:15.
Pushed by helfferich into branch 'master'.

Avoid occurence of invisible blocks.

When a line is removed, fill the top line with empty cells. Before, the
top line was not updated. This lead to the occurence of invisible blocks,
if pieces were stacked up to the top line before. This patch was suggested
by GJ in the discussion to bug #333694.
Related: bug 344506
REVIEW: 125578

M  +24   -0    KBlocksField.cpp

http://commits.kde.org/kblocks/65a1b8136535758c77f66b505255206fd13f3117