changeset 51:46b8f2109d34

*** empty log message ***
author gongo
date Wed, 08 Nov 2006 06:50:47 +0000
parents a333d360ea6f
children c875add6256e
files linda.c
diffstat 1 files changed, 37 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/linda.c	Wed Nov 08 06:46:17 2006 +0000
+++ b/linda.c	Wed Nov 08 06:50:47 2006 +0000
@@ -117,8 +117,14 @@
 
     for (i=1; i<=CLIENT_MAX; i++) {
 	get_packet(i, &flg, NULL, NULL, NULL, NULL);
-	if (i == id) continue;
-	if (flg == 1) connect++;
+	if (i == id) {
+	    flg = 0;
+	    continue;
+	}
+	if (flg == 1) {
+	    connect++;
+	    flg = 0;
+	}
     }
 
     if (connect == CLIENT_MAX) {
@@ -154,9 +160,14 @@
 
     for (i=1; i<=CLIENT_MAX; i++) {
 	get_packet(i, &flg, &mode, NULL, NULL, NULL);
-	if (i == id) continue;
-	if (flg == 1 && mode == MODE_WAIT_READY)
+	if (i == id) {
+	    flg = 0;
+	    continue;
+	}
+	if (flg == 1 && mode == MODE_WAIT_READY) {
 	    connect++;
+	    flg = 0;
+	}
     }
 
     if (connect == CLIENT_MAX) {
@@ -192,9 +203,14 @@
 
     for (i=1; i<=CLIENT_MAX; i++) {
 	get_packet(i, &flg, &mode, NULL, NULL, NULL);
-	if (i == id) continue;
-	if (flg == 1 && mode == MODE_OPENING)
+	if (i == id) {
+	    flg = 0;
+	    continue;
+	}
+	if (flg == 1 && mode == MODE_OPENING) {
 	    connect++;
+	    flg = 0;
+	}
     }
 
     if (connect == CLIENT_MAX) {
@@ -229,9 +245,14 @@
 
     for (i=1; i<=CLIENT_MAX; i++) {
 	get_packet(i, &flg, &mode, NULL, NULL, NULL);
-	if (i == id) continue;
-	if (flg == 1 && mode == MODE_SELECT_CAR)
+	if (i == id) {
+	    flg = 0;
+	    continue;
+	}
+	if (flg == 1 && mode == MODE_SELECT_CAR) {
 	    connect++;
+	    flg = 0;
+	}
     }
 
     if (connect == CLIENT_MAX) {
@@ -275,9 +296,15 @@
 
     for (i=1; i<=CLIENT_MAX; i++) {
 	get_packet(i, &flg, &mode, NULL, NULL, NULL);
-	if (i == id) continue;
-	if (flg == 1 && mode == MODE_SELECT_COURSE)
+	if (i == id) {
+	    flg = 0;
+	    continue;
+	}
+	if (flg == 1 && mode == MODE_SELECT_COURSE) {
 	    connect++;
+	    flg = 0;
+	}
+
     }
 
     if (connect == CLIENT_MAX) {