mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
6e3da841be
commit
be76de7b11
1 changed files with 1 additions and 8 deletions
|
@ -1433,7 +1433,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
int button;
|
int button;
|
||||||
int position;
|
int position;
|
||||||
bool selected = false;
|
bool selected = false;
|
||||||
bool no_movesavail;
|
|
||||||
int x=0, y=0;
|
int x=0, y=0;
|
||||||
|
|
||||||
bool loaded = jewels_loadgame(bj);
|
bool loaded = jewels_loadgame(bj);
|
||||||
|
@ -1443,8 +1442,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
|
|
||||||
resume_file = false;
|
resume_file = false;
|
||||||
while(true) {
|
while(true) {
|
||||||
no_movesavail = false;
|
|
||||||
|
|
||||||
/* refresh the board */
|
/* refresh the board */
|
||||||
jewels_drawboard(bj);
|
jewels_drawboard(bj);
|
||||||
|
|
||||||
|
@ -1470,7 +1467,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
if(selected) {
|
if(selected) {
|
||||||
bj->score += jewels_swapjewels(bj, x, y, SWAP_LEFT);
|
bj->score += jewels_swapjewels(bj, x, y, SWAP_LEFT);
|
||||||
selected = false;
|
selected = false;
|
||||||
if (!jewels_movesavail(bj)) no_movesavail = true;
|
|
||||||
} else {
|
} else {
|
||||||
x = (x+BJ_WIDTH-1)%BJ_WIDTH;
|
x = (x+BJ_WIDTH-1)%BJ_WIDTH;
|
||||||
}
|
}
|
||||||
|
@ -1481,7 +1477,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
if(selected) {
|
if(selected) {
|
||||||
bj->score += jewels_swapjewels(bj, x, y, SWAP_RIGHT);
|
bj->score += jewels_swapjewels(bj, x, y, SWAP_RIGHT);
|
||||||
selected = false;
|
selected = false;
|
||||||
if (!jewels_movesavail(bj)) no_movesavail = true;
|
|
||||||
} else {
|
} else {
|
||||||
x = (x+1)%BJ_WIDTH;
|
x = (x+1)%BJ_WIDTH;
|
||||||
}
|
}
|
||||||
|
@ -1492,7 +1487,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
if(selected) {
|
if(selected) {
|
||||||
bj->score += jewels_swapjewels(bj, x, y, SWAP_DOWN);
|
bj->score += jewels_swapjewels(bj, x, y, SWAP_DOWN);
|
||||||
selected = false;
|
selected = false;
|
||||||
if (!jewels_movesavail(bj)) no_movesavail = true;
|
|
||||||
} else {
|
} else {
|
||||||
y = (y+1)%(BJ_HEIGHT-1);
|
y = (y+1)%(BJ_HEIGHT-1);
|
||||||
}
|
}
|
||||||
|
@ -1503,7 +1497,6 @@ static int jewels_main(struct game_context* bj) {
|
||||||
if(selected) {
|
if(selected) {
|
||||||
bj->score += jewels_swapjewels(bj, x, y, SWAP_UP);
|
bj->score += jewels_swapjewels(bj, x, y, SWAP_UP);
|
||||||
selected = false;
|
selected = false;
|
||||||
if (!jewels_movesavail(bj)) no_movesavail = true;
|
|
||||||
} else {
|
} else {
|
||||||
y = (y+(BJ_HEIGHT-1)-1)%(BJ_HEIGHT-1);
|
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) {
|
switch(bj->type) {
|
||||||
case GAME_TYPE_NORMAL:
|
case GAME_TYPE_NORMAL:
|
||||||
rb->splash(HZ*2, "Game Over!");
|
rb->splash(HZ*2, "Game Over!");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue