commit c35c2b10
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];