return "";
}
+const struct score *level_score(int i, int s)
+{
+ return level_exists(i) ? &get_level(i)->scores[s] : NULL;
+}
+
/*---------------------------------------------------------------------------*/
int level_score_update(int level,
const char *level_name(int);
const char *level_msg (int);
+const struct score *level_score(int, int);
+
/*---------------------------------------------------------------------------*/
int level_score_update (int, int, int, int *, int *, int *);
int id, jd, kd, ld, md;
- const struct level *l = get_level(curr_level());
-
int high = progress_lvl_high();
+ int level = curr_level();
if (new_name)
{
}
- set_score_board(&l->scores[SCORE_MOST_COINS], progress_coin_rank(),
- &l->scores[SCORE_BEST_TIMES], progress_time_rank(),
- &l->scores[SCORE_FAST_UNLOCK], progress_goal_rank());
+ set_score_board(level_score(level, SCORE_MOST_COINS), progress_coin_rank(),
+ level_score(level, SCORE_BEST_TIMES), progress_time_rank(),
+ level_score(level, SCORE_FAST_UNLOCK), progress_goal_rank());
audio_music_fade_out(2.0f);
{
gui_set_image(shot_id, level_shot(i));
- set_score_board(&get_level(i)->scores[SCORE_MOST_COINS], -1,
- &get_level(i)->scores[SCORE_BEST_TIMES], -1,
- &get_level(i)->scores[SCORE_FAST_UNLOCK], -1);
+ set_score_board(level_score(i, SCORE_MOST_COINS), -1,
+ level_score(i, SCORE_BEST_TIMES), -1,
+ level_score(i, SCORE_FAST_UNLOCK), -1);
if (file_id)
gui_set_label(file_id, level_file(i));