… | |
… | |
323 | LOG (llevError, "Cannot open highscore file %s: %s\n", buf, strerror (errno)); |
323 | LOG (llevError, "Cannot open highscore file %s: %s\n", buf, strerror (errno)); |
324 | if (op != NULL) |
324 | if (op != NULL) |
325 | new_draw_info (NDI_UNIQUE, 0, op, "There is no highscore file."); |
325 | new_draw_info (NDI_UNIQUE, 0, op, "There is no highscore file."); |
326 | return; |
326 | return; |
327 | } |
327 | } |
328 | if (op != NULL) |
328 | |
329 | clear_win_info (op); |
|
|
330 | new_draw_info (NDI_UNIQUE, 0, op, "Nr Score Who [max hp][max sp][max grace]"); |
329 | new_draw_info (NDI_UNIQUE, 0, op, "Nr Score Who [max hp][max sp][max grace]"); |
331 | |
330 | |
332 | while (fgets (buf, MAX_BUF, fp) != NULL) |
331 | while (fgets (buf, MAX_BUF, fp) != NULL) |
333 | { |
332 | { |
334 | if (j >= HIGHSCORE_LENGTH || i >= (max - 1)) |
333 | if (j >= HIGHSCORE_LENGTH || i >= (max - 1)) |
335 | break; |
334 | break; |
|
|
335 | |
336 | if ((sc = get_score (buf)) == NULL) |
336 | if ((sc = get_score (buf)) == NULL) |
337 | break; |
337 | break; |
|
|
338 | |
338 | sc->position = ++j; |
339 | sc->position = ++j; |
339 | if (match == NULL) |
340 | if (match == NULL) |
340 | { |
341 | { |
341 | scorebuf = draw_one_high_score (sc); |
342 | scorebuf = draw_one_high_score (sc); |
342 | i++; |
343 | i++; |
… | |
… | |
349 | i++; |
350 | i++; |
350 | } |
351 | } |
351 | else |
352 | else |
352 | continue; |
353 | continue; |
353 | } |
354 | } |
|
|
355 | |
354 | /* Replaced what seemed to an overly complicated word wrap method |
356 | /* Replaced what seemed to an overly complicated word wrap method |
355 | * still word wraps, but assumes at most 2 lines of data. |
357 | * still word wraps, but assumes at most 2 lines of data. |
356 | * mw - 2-12-97 |
358 | * mw - 2-12-97 |
357 | */ |
359 | */ |
358 | assign (buf, scorebuf); |
360 | assign (buf, scorebuf); |
… | |
… | |
381 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
383 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
382 | } |
384 | } |
383 | |
385 | |
384 | close_and_delete (fp, comp); |
386 | close_and_delete (fp, comp); |
385 | } |
387 | } |
|
|
388 | |