TETRIS: fix bug where shadows took pieces out of bag
This commit is contained in:
parent
ca4ccbebc8
commit
b6a2e14507
@ -21,6 +21,7 @@ public:
|
||||
}
|
||||
TetrisBlock( const TetrisBlock &other ) : TetrisBlock(other.getDoubleRect().first.first,other.getDoubleRect().first.second,other.getDoubleRect().second.first,other.getDoubleRect().second.second,other.getRenderer(), other.getColor(), true, other._index, other._scene, other.pieces_bag) {}
|
||||
~TetrisBlock() {
|
||||
if(_index != PIECE_SHADOW)
|
||||
pieces_bag[_index]++;
|
||||
}
|
||||
virtual std::shared_ptr<RenderObject> copySelf() override {
|
||||
@ -55,6 +56,8 @@ public:
|
||||
}
|
||||
void turnIntoShadow() {
|
||||
setId(SHADOW_ID);
|
||||
// shadows don't consume pieces from bag
|
||||
pieces_bag[_index]++;
|
||||
_index = PIECE_SHADOW;
|
||||
setColors();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user