From a13c11aa18a142f55d3a5c8f2de9505573fb1c53 Mon Sep 17 00:00:00 2001 From: nls Date: Sun, 9 Jan 2011 18:54:21 +0000 Subject: [PATCH] jewels: hopefully fix FS#11842, by checking if there are available moves after checking if we should advance to the next level. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29013 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/jewels.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 0df7c35d8..02f814397 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -1433,7 +1433,6 @@ static int jewels_main(struct game_context* bj) { int button; int position; bool selected = false; - bool no_movesavail; int x=0, y=0; bool loaded = jewels_loadgame(bj); @@ -1443,8 +1442,6 @@ static int jewels_main(struct game_context* bj) { resume_file = false; while(true) { - no_movesavail = false; - /* refresh the board */ jewels_drawboard(bj); @@ -1470,7 +1467,6 @@ static int jewels_main(struct game_context* bj) { if(selected) { bj->score += jewels_swapjewels(bj, x, y, SWAP_LEFT); selected = false; - if (!jewels_movesavail(bj)) no_movesavail = true; } else { x = (x+BJ_WIDTH-1)%BJ_WIDTH; } @@ -1481,7 +1477,6 @@ static int jewels_main(struct game_context* bj) { if(selected) { bj->score += jewels_swapjewels(bj, x, y, SWAP_RIGHT); selected = false; - if (!jewels_movesavail(bj)) no_movesavail = true; } else { x = (x+1)%BJ_WIDTH; } @@ -1492,7 +1487,6 @@ static int jewels_main(struct game_context* bj) { if(selected) { bj->score += jewels_swapjewels(bj, x, y, SWAP_DOWN); selected = false; - if (!jewels_movesavail(bj)) no_movesavail = true; } else { y = (y+1)%(BJ_HEIGHT-1); } @@ -1503,7 +1497,6 @@ static int jewels_main(struct game_context* bj) { if(selected) { bj->score += jewels_swapjewels(bj, x, y, SWAP_UP); selected = false; - if (!jewels_movesavail(bj)) no_movesavail = true; } else { y = (y+(BJ_HEIGHT-1)-1)%(BJ_HEIGHT-1); } @@ -1569,7 +1562,7 @@ static int jewels_main(struct game_context* bj) { } } - if (no_movesavail) { + if (!jewels_movesavail(bj)) { switch(bj->type) { case GAME_TYPE_NORMAL: rb->splash(HZ*2, "Game Over!"); -- 2.11.4.GIT