diff options
author | Barry Wardell <rockbox@barrywardell.net> | 2006-10-18 00:06:08 +0000 |
---|---|---|
committer | Barry Wardell <rockbox@barrywardell.net> | 2006-10-18 00:06:08 +0000 |
commit | a2a7eba72c088c4a9bbb2f3abf14497d3487d1be (patch) | |
tree | 8f54e73ad10192753c165f1646122c1595932533 /apps | |
parent | 320059a2ec7dae8123ba01ef0f31d2f5365ccde0 (diff) | |
download | rockbox-a2a7eba72c088c4a9bbb2f3abf14497d3487d1be.tar.gz rockbox-a2a7eba72c088c4a9bbb2f3abf14497d3487d1be.zip |
Fix off-by-1 error in Bubbles level recording when you win. FS#6127. Thanks to Dave Hooper for the patch.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11252 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/plugins/bubbles.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index 45105feaf6..ae06c1e2a4 100755 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c | |||
@@ -2274,6 +2274,9 @@ static void bubbles_loadscores(struct game_context* bb) { | |||
2274 | /* scores are bad, reset */ | 2274 | /* scores are bad, reset */ |
2275 | rb->memset(bb->highscores, 0, sizeof(bb->highscores)); | 2275 | rb->memset(bb->highscores, 0, sizeof(bb->highscores)); |
2276 | } | 2276 | } |
2277 | |||
2278 | if( bb->highlevel >= NUM_LEVELS ) | ||
2279 | bb->highlevel = NUM_LEVELS - 1; | ||
2277 | 2280 | ||
2278 | rb->close(fd); | 2281 | rb->close(fd); |
2279 | } | 2282 | } |
@@ -2694,8 +2697,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
2694 | case BB_WIN: | 2697 | case BB_WIN: |
2695 | rb->splash(HZ*2, true, "You Win!"); | 2698 | rb->splash(HZ*2, true, "You Win!"); |
2696 | /* record high level */ | 2699 | /* record high level */ |
2697 | if(bb.level-1 > bb.highlevel) { | 2700 | if( NUM_LEVELS-1 > bb.highlevel) { |
2698 | bb.highlevel = bb.level-1; | 2701 | bb.highlevel = NUM_LEVELS-1; |
2699 | bb.dirty = true; | 2702 | bb.dirty = true; |
2700 | } | 2703 | } |
2701 | 2704 | ||