const int landermax = 12;
const int crawlermax = 6;
const int missilemax = 3;
-const float version = 1.05;
+const float version = 1.06;
int score;
int lives;
if(FILE *scorefile = fopen(home, "r")){
char workchara[6];
- fgets(workchara, 6, scorefile);
- hscore = atoi(workchara);
+ if(fgets(workchara, 6, scorefile) != NULL){
+ hscore = atoi(workchara);
+ };
fclose(scorefile);
} else {
FILE *scorefile = fopen(home, "w");
//Smart bomb
if(smartbombs<=3){smartbombs++;};
//regen landers
- int landerlimit;
+ int landerlimit = 0;
if(level<=4){landerlimit=8;};
if(level>4&&level<=12){landerlimit=6;};
if(level>12&&level<=16){landerlimit=8;};
};
};
//regen crawlers
- int crawlerlimit;
+ int crawlerlimit = 0;
if(level<=8){crawlerlimit=2;};
if(level>8&&level<=16){crawlerlimit=4;};
if(level>16){crawlerlimit=6;};
FILE *scorefile = fopen(home, "r");
char workchara[6];
- fgets(workchara, 6, scorefile);
- hscore = atoi(workchara);
+ if(fgets(workchara, 6, scorefile) != NULL){
+ hscore = atoi(workchara);
+ };
fclose(scorefile);
if(score>hscore){