diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_active.c | 10 | ||||
-rw-r--r-- | src/game/g_client.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 3 | ||||
-rw-r--r-- | src/game/g_local.h | 5 | ||||
-rw-r--r-- | src/game/g_main.c | 8 | ||||
-rw-r--r-- | src/game/g_public.h | 184 | ||||
-rw-r--r-- | src/game/g_syscalls.asm | 38 | ||||
-rw-r--r-- | src/game/g_syscalls.c | 45 | ||||
-rw-r--r-- | src/game/g_utils.c | 42 |
9 files changed, 56 insertions, 281 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index d78d4b98..99d4c308 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -217,9 +217,6 @@ void ClientImpacts( gentity_t *ent, pmove_t *pm ) other = &g_entities[ pm->touchents[ i ] ]; - if( ( ent->r.svFlags & SVF_BOT ) && ( ent->touch ) ) - ent->touch( ent, other, &trace ); - //charge attack if( ent->client->ps.weapon == WP_ALEVEL4 && ent->client->ps.stats[ STAT_MISC ] > 0 && @@ -306,9 +303,6 @@ void G_TouchTriggers( gentity_t *ent ) if( hit->touch ) hit->touch( hit, ent, &trace ); - - if( ( ent->r.svFlags & SVF_BOT ) && ( ent->touch ) ) - ent->touch( ent, hit, &trace ); } // if we didn't touch a jump pad this pmove frame @@ -1415,14 +1409,14 @@ void ClientThink( int clientNum ) // phone jack if they don't get any for a while ent->client->lastCmdTime = level.time; - if( !(ent->r.svFlags & SVF_BOT) && !g_synchronousClients.integer ) + if( !g_synchronousClients.integer ) ClientThink_real( ent ); } void G_RunClient( gentity_t *ent ) { - if( !( ent->r.svFlags & SVF_BOT ) && !g_synchronousClients.integer ) + if( !g_synchronousClients.integer ) return; ent->client->pers.cmd.serverTime = level.time; diff --git a/src/game/g_client.c b/src/game/g_client.c index f95b23af..b80451f3 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1117,7 +1117,7 @@ to the server machine, but qfalse on map changes and tournement restarts. ============ */ -char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ) +char *ClientConnect( int clientNum, qboolean firstTime ) { char *value; gclient_t *client; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index e881ad4e..6ce2d657 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -691,7 +691,7 @@ static void Cmd_Tell_f( gentity_t *ent ) G_Say( ent, target, SAY_TELL, p ); // don't tell to the player self if it was already directed to this player // also don't send the chat back to a bot - if( ent != target && !( ent->r.svFlags & SVF_BOT ) ) + if( ent != target ) G_Say( ent, ent, SAY_TELL, p ); } @@ -2054,7 +2054,6 @@ void G_StopFollowing( gentity_t *ent ) ent->client->ps.eFlags &= ~EF_WALLCLIMB; ent->client->ps.viewangles[ PITCH ] = 0.0f; - ent->r.svFlags &= ~SVF_BOT; ent->client->ps.clientNum = ent - g_entities; CalculateRanks( ); diff --git a/src/game/g_local.h b/src/game/g_local.h index a6009908..2dd36dc3 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -876,7 +876,7 @@ void QDECL G_Error( const char *fmt, ... ); // // g_client.c // -char *ClientConnect( int clientNum, qboolean firstTime, qboolean isBot ); +char *ClientConnect( int clientNum, qboolean firstTime ); void ClientUserinfoChanged( int clientNum ); void ClientDisconnect( int clientNum ); void ClientBegin( int clientNum ); @@ -1123,8 +1123,5 @@ void trap_BotFreeClient( int clientNum ); void trap_GetUsercmd( int clientNum, usercmd_t *cmd ); qboolean trap_GetEntityToken( char *buffer, int bufferSize ); -int trap_DebugPolygonCreate(int color, int numPoints, vec3_t *points); -void trap_DebugPolygonDelete(int id); - void trap_SnapVector( float *v ); void trap_SendGameStat( const char *data ); diff --git a/src/game/g_main.c b/src/game/g_main.c index 5fca0584..c8fd701b 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -240,7 +240,7 @@ intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, return 0; case GAME_CLIENT_CONNECT: - return (intptr_t)ClientConnect( arg0, arg1, arg2 ); + return (intptr_t)ClientConnect( arg0, arg1 ); case GAME_CLIENT_THINK: ClientThink( arg0 ); @@ -1197,8 +1197,7 @@ void CalculateRanks( void ) if( level.clients[ i ].pers.connected == CON_CONNECTED ) { level.numPlayingClients++; - if( !(g_entities[ i ].r.svFlags & SVF_BOT) ) - level.numVotingClients++; + level.numVotingClients++; if( level.clients[ i ].ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) level.numteamVotingClients[ 0 ]++; @@ -1646,9 +1645,6 @@ void CheckIntermissionExit( void ) if( cl->ps.stats[ STAT_PTEAM ] == PTE_NONE ) continue; - if( g_entities[ cl->ps.clientNum ].r.svFlags & SVF_BOT ) - continue; - if( cl->readyToExit ) { ready++; diff --git a/src/game/g_public.h b/src/game/g_public.h index ba7a6e69..fc6b7df3 100644 --- a/src/game/g_public.h +++ b/src/game/g_public.h @@ -35,7 +35,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=551 #define SVF_CLIENTMASK 0x00000002 -#define SVF_BOT 0x00000008 #define SVF_BROADCAST 0x00000020 // send to all connected clients #define SVF_PORTAL 0x00000040 // merge a second pvs at origin2 into snapshots #define SVF_USE_CURRENT_ORIGIN 0x00000080 // entity->r.currentOrigin instead of entity->s.origin @@ -200,11 +199,6 @@ typedef enum { G_ENTITY_CONTACT, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent ); // perform an exact check against inline brush models of non-square shape - // access for bots to get and free a server client (FIXME?) - G_BOT_ALLOCATE_CLIENT, // ( void ); - - G_BOT_FREE_CLIENT, // ( int clientNum ); - G_GET_USERCMD, // ( int clientNum, usercmd_t *cmd ) G_GET_ENTITY_TOKEN, // qboolean ( char *buffer, int bufferSize ) @@ -213,8 +207,6 @@ typedef enum { // This should only be done at GAME_INIT time. G_FS_GETFILELIST, - G_DEBUG_POLYGON_CREATE, - G_DEBUG_POLYGON_DELETE, G_REAL_TIME, G_SNAPVECTOR, @@ -224,169 +216,13 @@ typedef enum { // 1.32 G_FS_SEEK, - G_SEND_GAMESTAT, - - BOTLIB_SETUP = 200, // ( void ); - BOTLIB_SHUTDOWN, // ( void ); - BOTLIB_LIBVAR_SET, - BOTLIB_LIBVAR_GET, - BOTLIB_PC_ADD_GLOBAL_DEFINE, - BOTLIB_START_FRAME, - BOTLIB_LOAD_MAP, - BOTLIB_UPDATENTITY, - BOTLIB_TEST, - - BOTLIB_GET_SNAPSHOT_ENTITY, // ( int client, int ent ); - BOTLIB_GET_CONSOLE_MESSAGE, // ( int client, char *message, int size ); - BOTLIB_USER_COMMAND, // ( int client, usercmd_t *ucmd ); - - BOTLIB_AAS_ENABLE_ROUTING_AREA = 300, - BOTLIB_AAS_BBOX_AREAS, - BOTLIB_AAS_AREA_INFO, - BOTLIB_AAS_ENTITY_INFO, - - BOTLIB_AAS_INITIALIZED, - BOTLIB_AAS_PRESENCE_TYPE_BOUNDING_BOX, - BOTLIB_AAS_TIME, - - BOTLIB_AAS_POINT_AREA_NUM, - BOTLIB_AAS_TRACE_AREAS, - - BOTLIB_AAS_POINT_CONTENTS, - BOTLIB_AAS_NEXT_BSP_ENTITY, - BOTLIB_AAS_VALUE_FOR_BSP_EPAIR_KEY, - BOTLIB_AAS_VECTOR_FOR_BSP_EPAIR_KEY, - BOTLIB_AAS_FLOAT_FOR_BSP_EPAIR_KEY, - BOTLIB_AAS_INT_FOR_BSP_EPAIR_KEY, - - BOTLIB_AAS_AREA_REACHABILITY, - - BOTLIB_AAS_AREA_TRAVEL_TIME_TO_GOAL_AREA, - - BOTLIB_AAS_SWIMMING, - BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT, - - - - BOTLIB_EA_SAY = 400, - BOTLIB_EA_SAY_TEAM, - BOTLIB_EA_COMMAND, - - BOTLIB_EA_ACTION, - BOTLIB_EA_GESTURE, - BOTLIB_EA_TALK, - BOTLIB_EA_ATTACK, - BOTLIB_EA_USE, - BOTLIB_EA_RESPAWN, - BOTLIB_EA_CROUCH, - BOTLIB_EA_MOVE_UP, - BOTLIB_EA_MOVE_DOWN, - BOTLIB_EA_MOVE_FORWARD, - BOTLIB_EA_MOVE_BACK, - BOTLIB_EA_MOVE_LEFT, - BOTLIB_EA_MOVE_RIGHT, - - BOTLIB_EA_SELECT_WEAPON, - BOTLIB_EA_JUMP, - BOTLIB_EA_DELAYED_JUMP, - BOTLIB_EA_MOVE, - BOTLIB_EA_VIEW, - - BOTLIB_EA_END_REGULAR, - BOTLIB_EA_GET_INPUT, - BOTLIB_EA_RESET_INPUT, - - - - BOTLIB_AI_LOAD_CHARACTER = 500, - BOTLIB_AI_FREE_CHARACTER, - BOTLIB_AI_CHARACTERISTIC_FLOAT, - BOTLIB_AI_CHARACTERISTIC_BFLOAT, - BOTLIB_AI_CHARACTERISTIC_INTEGER, - BOTLIB_AI_CHARACTERISTIC_BINTEGER, - BOTLIB_AI_CHARACTERISTIC_STRING, - - BOTLIB_AI_ALLOC_CHAT_STATE, - BOTLIB_AI_FREE_CHAT_STATE, - BOTLIB_AI_QUEUE_CONSOLE_MESSAGE, - BOTLIB_AI_REMOVE_CONSOLE_MESSAGE, - BOTLIB_AI_NEXT_CONSOLE_MESSAGE, - BOTLIB_AI_NUM_CONSOLE_MESSAGE, - BOTLIB_AI_INITIAL_CHAT, - BOTLIB_AI_REPLY_CHAT, - BOTLIB_AI_CHAT_LENGTH, - BOTLIB_AI_ENTER_CHAT, - BOTLIB_AI_STRING_CONTAINS, - BOTLIB_AI_FIND_MATCH, - BOTLIB_AI_MATCH_VARIABLE, - BOTLIB_AI_UNIFY_WHITE_SPACES, - BOTLIB_AI_REPLACE_SYNONYMS, - BOTLIB_AI_LOAD_CHAT_FILE, - BOTLIB_AI_SET_CHAT_GENDER, - BOTLIB_AI_SET_CHAT_NAME, - - BOTLIB_AI_RESET_GOAL_STATE, - BOTLIB_AI_RESET_AVOID_GOALS, - BOTLIB_AI_PUSH_GOAL, - BOTLIB_AI_POP_GOAL, - BOTLIB_AI_EMPTY_GOAL_STACK, - BOTLIB_AI_DUMP_AVOID_GOALS, - BOTLIB_AI_DUMP_GOAL_STACK, - BOTLIB_AI_GOAL_NAME, - BOTLIB_AI_GET_TOP_GOAL, - BOTLIB_AI_GET_SECOND_GOAL, - BOTLIB_AI_CHOOSE_LTG_ITEM, - BOTLIB_AI_CHOOSE_NBG_ITEM, - BOTLIB_AI_TOUCHING_GOAL, - BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE, - BOTLIB_AI_GET_LEVEL_ITEM_GOAL, - BOTLIB_AI_AVOID_GOAL_TIME, - BOTLIB_AI_INIT_LEVEL_ITEMS, - BOTLIB_AI_UPDATE_ENTITY_ITEMS, - BOTLIB_AI_LOAD_ITEM_WEIGHTS, - BOTLIB_AI_FREE_ITEM_WEIGHTS, - BOTLIB_AI_SAVE_GOAL_FUZZY_LOGIC, - BOTLIB_AI_ALLOC_GOAL_STATE, - BOTLIB_AI_FREE_GOAL_STATE, - - BOTLIB_AI_RESET_MOVE_STATE, - BOTLIB_AI_MOVE_TO_GOAL, - BOTLIB_AI_MOVE_IN_DIRECTION, - BOTLIB_AI_RESET_AVOID_REACH, - BOTLIB_AI_RESET_LAST_AVOID_REACH, - BOTLIB_AI_REACHABILITY_AREA, - BOTLIB_AI_MOVEMENT_VIEW_TARGET, - BOTLIB_AI_ALLOC_MOVE_STATE, - BOTLIB_AI_FREE_MOVE_STATE, - BOTLIB_AI_INIT_MOVE_STATE, - - BOTLIB_AI_CHOOSE_BEST_FIGHT_WEAPON, - BOTLIB_AI_GET_WEAPON_INFO, - BOTLIB_AI_LOAD_WEAPON_WEIGHTS, - BOTLIB_AI_ALLOC_WEAPON_STATE, - BOTLIB_AI_FREE_WEAPON_STATE, - BOTLIB_AI_RESET_WEAPON_STATE, - - BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION, - BOTLIB_AI_INTERBREED_GOAL_FUZZY_LOGIC, - BOTLIB_AI_MUTATE_GOAL_FUZZY_LOGIC, - BOTLIB_AI_GET_NEXT_CAMP_SPOT_GOAL, - BOTLIB_AI_GET_MAP_LOCATION_GOAL, - BOTLIB_AI_NUM_INITIAL_CHATS, - BOTLIB_AI_GET_CHAT_MESSAGE, - BOTLIB_AI_REMOVE_FROM_AVOID_GOALS, - BOTLIB_AI_PREDICT_VISIBLE_POSITION, - - BOTLIB_AI_SET_AVOID_GOAL_TIME, - BOTLIB_AI_ADD_AVOID_SPOT, - BOTLIB_AAS_ALTERNATIVE_ROUTE_GOAL, - BOTLIB_AAS_PREDICT_ROUTE, - BOTLIB_AAS_POINT_REACHABILITY_AREA_INDEX, - - BOTLIB_PC_LOAD_SOURCE, - BOTLIB_PC_FREE_SOURCE, - BOTLIB_PC_READ_TOKEN, - BOTLIB_PC_SOURCE_FILE_AND_LINE + G_PARSE_ADD_GLOBAL_DEFINE, + G_PARSE_LOAD_SOURCE, + G_PARSE_FREE_SOURCE, + G_PARSE_READ_TOKEN, + G_PARSE_SOURCE_FILE_AND_LINE, + + G_SEND_GAMESTAT } gameImport_t; @@ -401,7 +237,7 @@ typedef enum { GAME_SHUTDOWN, // (void); - GAME_CLIENT_CONNECT, // ( int clientNum, qboolean firstTime, qboolean isBot ); + GAME_CLIENT_CONNECT, // ( int clientNum, qboolean firstTime ); // return NULL if the client is allowed to connect, otherwise return // a text string with the reason for denial @@ -417,12 +253,10 @@ typedef enum { GAME_RUN_FRAME, // ( int levelTime ); - GAME_CONSOLE_COMMAND, // ( void ); + GAME_CONSOLE_COMMAND // ( void ); // ConsoleCommand will be called when a command has been issued // that is not recognized as a builtin function. // The game can issue trap_argc() / trap_argv() commands to get the command // and parameters. Return qfalse if the game doesn't recognize it as a command. - - BOTAI_START_FRAME // ( int time ); } gameExport_t; diff --git a/src/game/g_syscalls.asm b/src/game/g_syscalls.asm index fda100a0..79a9b3d6 100644 --- a/src/game/g_syscalls.asm +++ b/src/game/g_syscalls.asm @@ -34,29 +34,19 @@ equ trap_LinkEntity -31 equ trap_UnlinkEntity -32 equ trap_EntitiesInBox -33 equ trap_EntityContact -34 -equ trap_BotAllocateClient -35 -equ trap_BotFreeClient -36 -equ trap_GetUsercmd -37 -equ trap_GetEntityToken -38 -equ trap_FS_GetFileList -39 -equ trap_DebugPolygonCreate -40 -equ trap_DebugPolygonDelete -41 -equ trap_RealTime -42 -equ trap_SnapVector -43 -equ trap_TraceCapsule -44 -equ trap_EntityContactCapsule -45 -equ trap_FS_Seek -46 -equ trap_SendGameStat -47 +equ trap_GetUsercmd -35 +equ trap_GetEntityToken -36 +equ trap_FS_GetFileList -37 +equ trap_RealTime -38 +equ trap_SnapVector -39 +equ trap_TraceCapsule -40 +equ trap_EntityContactCapsule -41 +equ trap_FS_Seek -42 +equ trap_Parse_AddGlobalDefine -43 +equ trap_Parse_LoadSource -44 +equ trap_Parse_FreeSource -45 +equ trap_Parse_ReadToken -46 +equ trap_Parse_SourceFileAndLine -47 -equ memset -101 -equ memcpy -102 -equ strncpy -103 -equ sin -104 -equ cos -105 -equ atan2 -106 -equ sqrt -107 -equ floor -111 -equ ceil -112 -equ testPrintInt -113 -equ testPrintFloat -114 +equ trap_SendGameStat -48 diff --git a/src/game/g_syscalls.c b/src/game/g_syscalls.c index b6347441..cb4ceb66 100644 --- a/src/game/g_syscalls.c +++ b/src/game/g_syscalls.c @@ -229,15 +229,6 @@ qboolean trap_EntityContactCapsule( const vec3_t mins, const vec3_t maxs, const { return syscall( G_ENTITY_CONTACTCAPSULE, mins, maxs, ent ); } -int trap_BotAllocateClient( void ) -{ - return syscall( G_BOT_ALLOCATE_CLIENT ); -} - -void trap_BotFreeClient( int clientNum ) -{ - syscall( G_BOT_FREE_CLIENT, clientNum ); -} void trap_GetUsercmd( int clientNum, usercmd_t *cmd ) { @@ -249,16 +240,6 @@ qboolean trap_GetEntityToken( char *buffer, int bufferSize ) return syscall( G_GET_ENTITY_TOKEN, buffer, bufferSize ); } -int trap_DebugPolygonCreate(int color, int numPoints, vec3_t *points) -{ - return syscall( G_DEBUG_POLYGON_CREATE, color, numPoints, points ); -} - -void trap_DebugPolygonDelete(int id) -{ - syscall( G_DEBUG_POLYGON_DELETE, id ); -} - int trap_RealTime( qtime_t *qtime ) { return syscall( G_REAL_TIME, qtime ); @@ -275,3 +256,29 @@ void trap_SendGameStat( const char *data ) syscall( G_SEND_GAMESTAT, data ); return; } + +int trap_Parse_AddGlobalDefine( char *define ) +{ + return syscall( G_PARSE_ADD_GLOBAL_DEFINE, define ); +} + +int trap_Parse_LoadSource( const char *filename ) +{ + return syscall( G_PARSE_LOAD_SOURCE, filename ); +} + +int trap_Parse_FreeSource( int handle ) +{ + return syscall( G_PARSE_FREE_SOURCE, handle ); +} + +int trap_Parse_ReadToken( int handle, pc_token_t *pc_token ) +{ + return syscall( G_PARSE_READ_TOKEN, handle, pc_token ); +} + +int trap_Parse_SourceFileAndLine( int handle, char *filename, int *line ) +{ + return syscall( G_PARSE_SOURCE_FILE_AND_LINE, handle, filename, line ); +} + diff --git a/src/game/g_utils.c b/src/game/g_utils.c index 9caaba76..a3b2cb42 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -837,45 +837,3 @@ void G_CloseMenus( int clientNum ) Com_sprintf( buffer, 32, "serverclosemenus" ); trap_SendServerCommand( clientNum, buffer ); } - - -/* -================ -DebugLine - - debug polygons only work when running a local game - with r_debugSurface set to 2 -================ -*/ -int DebugLine( vec3_t start, vec3_t end, int color ) -{ - vec3_t points[ 4 ], dir, cross, up = { 0, 0, 1 }; - float dot; - - VectorCopy( start, points[ 0 ] ); - VectorCopy( start, points[ 1 ] ); - //points[1][2] -= 2; - VectorCopy( end, points[ 2 ] ); - //points[2][2] -= 2; - VectorCopy( end, points[ 3 ] ); - - - VectorSubtract( end, start, dir ); - VectorNormalize( dir ); - dot = DotProduct( dir, up ); - - if( dot > 0.99 || dot < -0.99 ) - VectorSet( cross, 1, 0, 0 ); - else - CrossProduct( dir, up, cross ); - - VectorNormalize( cross ); - - VectorMA(points[ 0 ], 2, cross, points[ 0 ] ); - VectorMA(points[ 1 ], -2, cross, points[ 1 ] ); - VectorMA(points[ 2 ], -2, cross, points[ 2 ] ); - VectorMA(points[ 3 ], 2, cross, points[ 3 ] ); - - return trap_DebugPolygonCreate( color, 4, points ); -} - |