Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS update: Vanilla/robots



Date:	Saturday May 27, 2000 @ 2:44
Author:	jeffno

Update of /home/netrek/cvsroot/Vanilla/robots
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv8449

Modified Files:
	puckmove.c 
Log Message:
Require at least 10 seconds to score for faceoffs close to end of period.

****************************************

Index: Vanilla/robots/puckmove.c
diff -u Vanilla/robots/puckmove.c:1.3 Vanilla/robots/puckmove.c:1.4
--- Vanilla/robots/puckmove.c:1.3	Mon Jul 12 19:20:26 1999
+++ Vanilla/robots/puckmove.c	Sat May 27 02:44:24 2000
@@ -263,14 +263,19 @@
     /* first priority:  is this faceoff mode?     */
     /* Messages are checked once per second here  */
     if (faceoff > 0) {
+        int ticks_left;
 
-	if (short_game){
-	  roboclock++;
-	  if ( (END_OF_PERIOD - roboclock) <= faceoff){
-	    roboclock=END_OF_PERIOD;
-	    messAll(me->p_no,roboname,"  Period Ends before faceoff!");
-	  }
-	}
+        if (short_game){
+            roboclock++;
+            ticks_left = END_OF_PERIOD - roboclock - faceoff;
+        }
+        else
+            ticks_left = END_OF_PERIOD - roboclock;
+
+        if (ticks_left <= 10*PERSEC) {
+            roboclock = END_OF_PERIOD;
+            messAll(me->p_no,roboname,"  Less than 10 seconds to score, Period Ends!");
+        }
 
         if ((faceoff % (PERSEC)) == 0) do_msg_check();
 	faceoff--;