summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2010-02-27 07:58:48 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2010-02-27 07:58:48 +0000
commite96f05822f9514046908ce027ba8834faa72da20 (patch)
tree175426f2368c9038a18e0bd77c1d0c5f5ed219b8 /apps
parent43e95cf7e58128b2947a560857d6988771ae08a5 (diff)
Brickmania: Fix inner loop used the same variable as outer loop, which trashed
powerups when paddle hit Normal or Fire powerups git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24932 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/brickmania.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 728651a45f..9648df3add 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1603,14 +1603,14 @@ static int brickmania_game_loop(void)
case POWER_TYPE_PADDLE_SHOOTER:
score += SCORE_POWER_PADDLE_SHOOTER;
paddle_type = PADDLE_TYPE_SHOOTER;
- for(k=0;k<used_balls;k++)
- ball[k].glue=false;
+ for(i=0;i<used_balls;i++)
+ ball[i].glue=false;
break;
case POWER_TYPE_PADDLE_NORMAL:
score += SCORE_POWER_PADDLE_NORMAL;
paddle_type = PADDLE_TYPE_NORMAL;
- for(k=0;k<used_balls;k++)
- ball[k].glue=false;
+ for(i=0;i<used_balls;i++)
+ ball[i].glue=false;
flip_sides=false;
pad_pos_x += (pad_width-PAD_WIDTH)/2;
pad_width = PAD_WIDTH;
@@ -1677,9 +1677,12 @@ static int brickmania_game_loop(void)
if (remove_power)
{
used_powers--;
- power[k].top = power[used_powers].top;
- power[k].x_pos = power[used_powers].x_pos;
- power[k].type = power[used_powers].type;
+ if (k != used_powers)
+ {
+ power[k].top = power[used_powers].top;
+ power[k].x_pos = power[used_powers].x_pos;
+ power[k].type = power[used_powers].type;
+ }
k--;
}
}