git repos / blockattack-game

commit 7013ad1a

sago007 · 2018-03-25 09:55
7013ad1a03f432d536eeb60bb674b7863826e02e patch · browse files
parent 1d2a7a1a3aebdc319a45db2bdf3a89fe5c1c8563

Small adjustments

Changed files

M source/code/BlockGame.cpp before
M source/code/BlockGame.hpp before
diff --git a/source/code/BlockGame.cpp b/source/code/BlockGame.cpp index b4e7f68..6d1c0e2 100644 --- a/source/code/BlockGame.cpp +++ b/source/code/BlockGame.cpp
@@ -1308,10 +1308,9 @@ int BlockGame::nrOfType(int line, int type) {
int BlockGame::horiInLine(int line) {
//cout << "Start_ hori in line" << "\n";
int nrOfType[7] = {0, 0, 0, 0, 0, 0, 0};
- int iTemp;
int max = 0;
for (int i=0; i<6; i++) {
- iTemp = board[i][line];
+ int iTemp = board[i][line];
if ((iTemp>-1)&&(iTemp<7)) {
nrOfType[iTemp]++;
}
diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp index cc7932e..5c4a9e2 100644 --- a/source/code/BlockGame.hpp +++ b/source/code/BlockGame.hpp
@@ -146,7 +146,7 @@ private:
int nrPushedPixel = 0;
int nrFellDown = 0;
unsigned int nrStops = 0;
- bool garbageToBeCleared[7][30];
+ bool garbageToBeCleared[7][30] = {};
unsigned int lastAImove = 0;
int AI_LineOffset = 0; //how many lines have changed since command