summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-11-16 21:08:23 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-11-16 21:08:23 +0000
commit526fc164aef4efee0b45a225c952eeb63875a667 (patch)
tree5730ae58dc1daf082d42ba94ef342d809863394c
parentc9184057e888f237218d0d3d8afa9d01d3a75b4b (diff)
downloadrockbox-526fc164aef4efee0b45a225c952eeb63875a667.tar.gz
rockbox-526fc164aef4efee0b45a225c952eeb63875a667.zip
End-of-game bug fixed by Bluechip
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4031 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/othelo.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/apps/plugins/othelo.c b/apps/plugins/othelo.c
index b30856d54e..688021e087 100644
--- a/apps/plugins/othelo.c
+++ b/apps/plugins/othelo.c
@@ -2,7 +2,7 @@
2 Designed, Written, AI Bots, the lot ...BlueChip =8ĒD# 2 Designed, Written, AI Bots, the lot ...BlueChip =8ĒD#
3 3
4 Thanks espcially to 4 Thanks espcially to
5 DevZer0, LinusN, Zagor 5 DevZer0, LinusN, Zagor, scott666
6 for their help with understanding Rockbox & the SDK 6 for their help with understanding Rockbox & the SDK
7 7
8 Please note that the code formatting is not that which was 8 Please note that the code formatting is not that which was
@@ -15,6 +15,7 @@
15/* 15/*
16 * Version Date Who Comment 16 * Version Date Who Comment
17 * -------- -------- ---- ------------------------------------------------ 17 * -------- -------- ---- ------------------------------------------------
18 * 1.4 20030729 BC Ensure game terminates even if dreamer disabled
18 * 1.3 20030729 BC Fixed display bug introduced by port to plugin 19 * 1.3 20030729 BC Fixed display bug introduced by port to plugin
19 * Updated documentation 20 * Updated documentation
20 * 1.2 2003 Ported to new plugin system 21 * 1.2 2003 Ported to new plugin system
@@ -30,10 +31,11 @@
30 * # Reintroduce suspend feature under plugin system 31 * # Reintroduce suspend feature under plugin system
31 */ 32 */
32 33
33/* Plugin header */
34#include "plugin.h"
35 34
36#ifdef HAVE_LCD_BITMAP 35#ifdef HAVE_LCD_BITMAP
36
37/* Plugin header */
38#include "plugin.h"
37static struct plugin_api* rb; 39static struct plugin_api* rb;
38 40
39/***************************************************************************/ 41/***************************************************************************/
@@ -1194,16 +1196,16 @@ static bool calcposs(struct move* plist, unsigned char* pcnt, bool turn)
1194{ 1196{
1195 int i; 1197 int i;
1196 1198
1199 /* get list of all possible moves */
1200 (*pcnt) = getplist(plist, turn);
1201
1202 /* no moves? trigger Game Over */
1203 if (!(*pcnt))
1204 return(true);
1205
1197 /* only evaluate moves for AIBOTs or HUMAN+HELP */ 1206 /* only evaluate moves for AIBOTs or HUMAN+HELP */
1198 if ( (player[turn]==AIBOT) || (ai_help[turn]) ) 1207 if ( (player[turn]==AIBOT) || (ai_help[turn]) )
1199 { 1208 {
1200 /* get list of all possible moves */
1201 (*pcnt) = getplist(plist, turn);
1202
1203 /* no moves? trigger Game Over */
1204 if (!(*pcnt))
1205 return(true);
1206
1207 /* mark all possible moves on board */ 1209 /* mark all possible moves on board */
1208 for (i=0; i<(*pcnt); i++) 1210 for (i=0; i<(*pcnt); i++)
1209 board[plist[i].y][plist[i].x] = POSS; 1211 board[plist[i].y][plist[i].x] = POSS;