From 53c3eebcdb3078fe23c902da19753322bb1cc63e Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Fri, 6 Oct 2006 16:20:57 +0000 Subject: Fix FS#6126 - bug in Star where non-existant level 20 was accessable after you finish the game. Also fix spelling error in Star mentioned in the same bug report. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11139 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/star.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 956b0debab..ce18f0e704 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -873,8 +873,12 @@ static int star_run_game(void) if (current_level == STAR_LEVEL_COUNT) { rb->lcd_clear_display(); - star_display_text("Congratulation !", true); + star_display_text("Congratulations!", true); rb->lcd_update(); + + /* There is no such level as STAR_LEVEL_COUNT so it can't be the + * current_level */ + current_level--; return 1; } star_load_level(current_level); @@ -895,8 +899,9 @@ static int star_choose_level(void) while (true) { rb->lcd_clear_display(); + /* levels are numbered 0 to (STAR_LEVEL_COUNT-1) */ rb->snprintf(str_info, sizeof(str_info), "Level:%02d / %02d", - level,STAR_LEVEL_COUNT); + level,(STAR_LEVEL_COUNT-1)); rb->lcd_putsxy(0, 0, str_info); rb->lcd_update(); key = rb->button_get(true); -- cgit v1.2.3