[quake3-commits] r1858 - trunk/code/botlib

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Feb 4 13:23:53 EST 2011


Author: thilo
Date: 2011-02-04 13:23:52 -0500 (Fri, 04 Feb 2011)
New Revision: 1858

Modified:
   trunk/code/botlib/be_ea.c
   trunk/code/botlib/botlib.h
Log:
Fix flag collision in botlib code, thanks Cyrri for reporting (#4886)


Modified: trunk/code/botlib/be_ea.c
===================================================================
--- trunk/code/botlib/be_ea.c	2011-02-04 17:50:34 UTC (rev 1857)
+++ trunk/code/botlib/be_ea.c	2011-02-04 18:23:52 UTC (rev 1858)
@@ -40,7 +40,6 @@
 
 #define MAX_USERMOVE				400
 #define MAX_COMMANDARGUMENTS		10
-#define ACTION_JUMPEDLASTFRAME		128
 
 bot_input_t *botinputs;
 
@@ -416,24 +415,6 @@
 //===========================================================================
 void EA_EndRegular(int client, float thinktime)
 {
-/*
-	bot_input_t *bi;
-	int jumped = qfalse;
-
-	bi = &botinputs[client];
-
-	bi->actionflags &= ~ACTION_JUMPEDLASTFRAME;
-
-	bi->thinktime = thinktime;
-	botimport.BotInput(client, bi);
-
-	bi->thinktime = 0;
-	VectorClear(bi->dir);
-	bi->speed = 0;
-	jumped = bi->actionflags & ACTION_JUMP;
-	bi->actionflags = 0;
-	if (jumped) bi->actionflags |= ACTION_JUMPEDLASTFRAME;
-*/
 } //end of the function EA_EndRegular
 //===========================================================================
 //
@@ -444,23 +425,10 @@
 void EA_GetInput(int client, float thinktime, bot_input_t *input)
 {
 	bot_input_t *bi;
-//	int jumped = qfalse;
 
 	bi = &botinputs[client];
-
-//	bi->actionflags &= ~ACTION_JUMPEDLASTFRAME;
-
 	bi->thinktime = thinktime;
 	Com_Memcpy(input, bi, sizeof(bot_input_t));
-
-	/*
-	bi->thinktime = 0;
-	VectorClear(bi->dir);
-	bi->speed = 0;
-	jumped = bi->actionflags & ACTION_JUMP;
-	bi->actionflags = 0;
-	if (jumped) bi->actionflags |= ACTION_JUMPEDLASTFRAME;
-	*/
 } //end of the function EA_GetInput
 //===========================================================================
 //
@@ -474,7 +442,6 @@
 	int jumped = qfalse;
 
 	bi = &botinputs[client];
-	bi->actionflags &= ~ACTION_JUMPEDLASTFRAME;
 
 	bi->thinktime = 0;
 	VectorClear(bi->dir);

Modified: trunk/code/botlib/botlib.h
===================================================================
--- trunk/code/botlib/botlib.h	2011-02-04 17:50:34 UTC (rev 1857)
+++ trunk/code/botlib/botlib.h	2011-02-04 18:23:52 UTC (rev 1858)
@@ -79,27 +79,28 @@
 #define BLERR_CANNOTLOADWEAPONCONFIG	12	//cannot load weapon config
 
 //action flags
-#define ACTION_ATTACK			0x0000001
-#define ACTION_USE				0x0000002
-#define ACTION_RESPAWN			0x0000008
-#define ACTION_JUMP				0x0000010
-#define ACTION_MOVEUP			0x0000020
-#define ACTION_CROUCH			0x0000080
-#define ACTION_MOVEDOWN			0x0000100
-#define ACTION_MOVEFORWARD		0x0000200
-#define ACTION_MOVEBACK			0x0000800
-#define ACTION_MOVELEFT			0x0001000
-#define ACTION_MOVERIGHT		0x0002000
-#define ACTION_DELAYEDJUMP		0x0008000
-#define ACTION_TALK				0x0010000
-#define ACTION_GESTURE			0x0020000
-#define ACTION_WALK				0x0080000
-#define ACTION_AFFIRMATIVE		0x0100000
-#define ACTION_NEGATIVE			0x0200000
-#define ACTION_GETFLAG			0x0800000
-#define ACTION_GUARDBASE		0x1000000
-#define ACTION_PATROL			0x2000000
-#define ACTION_FOLLOWME			0x8000000
+#define ACTION_ATTACK			0x00000001
+#define ACTION_USE			0x00000002
+#define ACTION_RESPAWN			0x00000008
+#define ACTION_JUMP			0x00000010
+#define ACTION_MOVEUP			0x00000020
+#define ACTION_CROUCH			0x00000080
+#define ACTION_MOVEDOWN			0x00000100
+#define ACTION_MOVEFORWARD		0x00000200
+#define ACTION_MOVEBACK			0x00000800
+#define ACTION_MOVELEFT			0x00001000
+#define ACTION_MOVERIGHT		0x00002000
+#define ACTION_DELAYEDJUMP		0x00008000
+#define ACTION_TALK			0x00010000
+#define ACTION_GESTURE			0x00020000
+#define ACTION_WALK			0x00080000
+#define ACTION_AFFIRMATIVE		0x00100000
+#define ACTION_NEGATIVE			0x00200000
+#define ACTION_GETFLAG			0x00800000
+#define ACTION_GUARDBASE		0x01000000
+#define ACTION_PATROL			0x02000000
+#define ACTION_FOLLOWME			0x08000000
+#define ACTION_JUMPEDLASTFRAME		0x10000000
 
 //the bot input, will be converted to an usercmd_t
 typedef struct bot_input_s



More information about the quake3-commits mailing list