version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_hiscore_c = | | * static char *rcsid_hiscore_c = |
* "$Id: hiscore.c,v 1.12 2005/08/12 08:18:59 ryo_saeba Exp $"; | | * "$Id: hiscore.c,v 1.13 2005/09/04 16:58:12 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if(!flag&&nrofscores<HIGHSCORE_LENGTH) | | if(!flag&&nrofscores<HIGHSCORE_LENGTH) |
copy_score(new_score,&pscore[nrofscores++]); | | copy_score(new_score,&pscore[nrofscores++]); |
if((fp=fopen(filename,"w"))==NULL) { | | if((fp=fopen(filename,"w"))==NULL) { |
perror("Can't write to highscore-list.\n"); | | LOG(llevError, "Cannot write to highscore file %s: %s\n", filename, strerror_local(errno)); |
return NULL; | | return NULL; |
} | | } |
for(i=0;i<nrofscores;i++) { | | for(i=0;i<nrofscores;i++) { |
| | |
| | |
sprintf(buf,"%s/%s",settings.localdir,HIGHSCORE); | | sprintf(buf,"%s/%s",settings.localdir,HIGHSCORE); |
if((fp=open_and_uncompress(buf,0,&comp))==NULL) { | | if((fp=open_and_uncompress(buf,0,&comp))==NULL) { |
perror("Can't open highscore file"); | | LOG(llevError, "Cannot open highscore file %s: %s\n", buf, strerror_local(errno)); |
if(op!=NULL) | | if(op!=NULL) |
new_draw_info(NDI_UNIQUE, 0,op,"There is no highscore file."); | | new_draw_info(NDI_UNIQUE, 0,op,"There is no highscore file."); |
return; | | return; |
| | |
while (*bp != ' ' && bp>cp) bp--; | | while (*bp != ' ' && bp>cp) bp--; |
*bp='\0'; | | *bp='\0'; |
if (op == NULL) { | | if (op == NULL) { |
printf("%s\n",cp); | | LOG(llevDebug, "%s\n", cp); |
} | | } |
else { | | else { |
new_draw_info(NDI_UNIQUE, 0,op,cp); | | new_draw_info(NDI_UNIQUE, 0,op,cp); |
| | |
i++; | | i++; |
} | | } |
if(op == NULL) | | if(op == NULL) |
printf("%s\n",buf); | | LOG(llevDebug, "%s\n", buf); |
else | | else |
new_draw_info(NDI_UNIQUE, 0,op,buf); | | new_draw_info(NDI_UNIQUE, 0,op,buf); |
} | | } |