git repos / blockattack-game

commit c35c2b10

sago007 · 2016-03-31 18:49
c35c2b1015fab3f9725d1062fd73c6e3580f00c7 patch · browse files
parent a133dbceccb2748b5629da0e861ea425aa9392ca

Removed comment and added a check.

Changed files

M source/code/puzzlehandler.cpp before
diff --git a/source/code/puzzlehandler.cpp b/source/code/puzzlehandler.cpp index 324ab32..357bcda 100644 --- a/source/code/puzzlehandler.cpp +++ b/source/code/puzzlehandler.cpp
@@ -118,8 +118,11 @@ int LoadPuzzleStages( ) {
if (nrOfPuzzles>maxNrOfPuzzleStages) {
nrOfPuzzles=maxNrOfPuzzleStages;
}
- for (int k=0; (k<nrOfPuzzles) /*&&(!inFile.eof())*/ ; k++) {
- inFile >> nrOfMovesAllowed[k];
+ if (nrOfPuzzles < 0) {
+ nrOfPuzzles = 0;
+ }
+ for (int k=0; k<nrOfPuzzles ; k++) {
+ inFile >> nrOfMovesAllowed.at(k);
for (int i=11; i>=0; i--)
for (int j=0; j<6; j++) {
inFile >> puzzleLevels[k][j][i];