changeset 50:a333d360ea6f

*** empty log message ***
author gongo
date Wed, 08 Nov 2006 06:46:17 +0000
parents 30fe49501a99
children 46b8f2109d34
files linda.c
diffstat 1 files changed, 8 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/linda.c	Wed Nov 08 06:32:30 2006 +0000
+++ b/linda.c	Wed Nov 08 06:46:17 2006 +0000
@@ -116,10 +116,8 @@
     int connect = 1; // 接続済みユーザ数
 
     for (i=1; i<=CLIENT_MAX; i++) {
+	get_packet(i, &flg, NULL, NULL, NULL, NULL);
 	if (i == id) continue;
-
-	get_packet(i, &flg, NULL, NULL, NULL, NULL);
-
 	if (flg == 1) connect++;
     }
 
@@ -155,9 +153,8 @@
     int connect = 1;
 
     for (i=1; i<=CLIENT_MAX; i++) {
+	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (i == id) continue;
-
-	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (flg == 1 && mode == MODE_WAIT_READY)
 	    connect++;
     }
@@ -194,9 +191,8 @@
     int connect = 1;
 
     for (i=1; i<=CLIENT_MAX; i++) {
+	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (i == id) continue;
-
-	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (flg == 1 && mode == MODE_OPENING)
 	    connect++;
     }
@@ -232,9 +228,8 @@
     int connect = 1;
 
     for (i=1; i<=CLIENT_MAX; i++) {
+	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (i == id) continue;
-
-	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (flg == 1 && mode == MODE_SELECT_CAR)
 	    connect++;
     }
@@ -267,20 +262,20 @@
 {
     int i;
     int flg, mode;
-    int connect;
+    int connect = 1;
     int id = game.play_id;
     static int course_id = 1;
 
     if (course_id != game.course_id) {
 	course_id = game.course_id;
+	linda_seq[game.play_id] = psx_in(game.play_id);
 	send_packet(game.play_id, MODE_SELECT_COURSE, 0, course_id, NULL);
-	return TRUE;
+	return FALSE;
     }
 
     for (i=1; i<=CLIENT_MAX; i++) {
+	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (i == id) continue;
-
-	get_packet(i, &flg, &mode, NULL, NULL, NULL);
 	if (flg == 1 && mode == MODE_SELECT_COURSE)
 	    connect++;
     }