diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_lib.c | 29 | ||||
-rw-r--r-- | src/game/bg_misc.c | 16 | ||||
-rw-r--r-- | src/game/bg_public.h | 11 | ||||
-rw-r--r-- | src/game/bg_slidemove.c | 6 | ||||
-rw-r--r-- | src/game/g_active.c | 38 | ||||
-rw-r--r-- | src/game/g_client.c | 32 | ||||
-rw-r--r-- | src/game/g_cmds.c | 3 | ||||
-rw-r--r-- | src/game/g_local.h | 3 | ||||
-rw-r--r-- | src/game/g_main.c | 9 | ||||
-rw-r--r-- | src/game/g_misc.c | 13 | ||||
-rw-r--r-- | src/game/g_mover.c | 83 | ||||
-rw-r--r-- | src/game/g_public.h | 11 | ||||
-rw-r--r-- | src/game/g_session.c | 16 | ||||
-rw-r--r-- | src/game/g_spawn.c | 13 | ||||
-rw-r--r-- | src/game/g_svcmds.c | 2 | ||||
-rw-r--r-- | src/game/g_syscalls.asm | 7 | ||||
-rw-r--r-- | src/game/g_syscalls.c | 23 | ||||
-rw-r--r-- | src/game/g_team.c | 2 | ||||
-rw-r--r-- | src/game/g_utils.c | 2 | ||||
-rw-r--r-- | src/game/g_weapon.c | 2 | ||||
-rw-r--r-- | src/game/q_shared.h | 2 |
21 files changed, 247 insertions, 76 deletions
diff --git a/src/game/bg_lib.c b/src/game/bg_lib.c index 45bb3618..53f08ee5 100644 --- a/src/game/bg_lib.c +++ b/src/game/bg_lib.c @@ -72,7 +72,11 @@ static const char rcsid[] = "$Id$"; #endif /* LIBC_SCCS and not lint */ -//typedef int cmp_t(const void *, const void *); +// bk001127 - needed for DLL's +#if !defined( Q3_VM ) +typedef int cmp_t(const void *, const void *); +#endif + static char* med3(char *, char *, char *, cmp_t *); static void swapfunc(char *, char *, int, int); @@ -215,6 +219,9 @@ loop: SWAPINIT(a, es); // this file is excluded from release builds because of intrinsics +// bk001211 - gcc errors on compiling strcpy: parse error before `__extension__' +#if defined ( Q3_VM ) + size_t strlen( const char *string ) { const char *s; @@ -288,7 +295,12 @@ char *strstr( const char *string, const char *strCharSet ) { return (char *)0; } -#if !defined ( _MSC_VER ) && !defined ( __linux__ ) +#endif // bk001211 + +// bk001120 - presumably needed for Mac +//#if !defined(_MSC_VER) && !defined(__linux__) +// bk001127 - undid undo +#if defined ( Q3_VM ) int tolower( int c ) { if ( c >= 'A' && c <= 'Z' ) { @@ -777,9 +789,14 @@ double atan2( double y, double x ) { #endif +#ifdef Q3_VM +// bk001127 - guarded this tan replacement +// ld: undefined versioned symbol name tan@@GLIBC_2.0 double tan( double x ) { return sin(x) / cos(x); } +#endif + static int randSeed = 0; @@ -864,7 +881,7 @@ double _atof( const char **stringPtr ) { const char *string; float sign; float value; - int c; + int c = '0'; // bk001211 - uninitialized use possible string = *stringPtr; @@ -929,7 +946,11 @@ double _atof( const char **stringPtr ) { } -#if !defined( _MSC_VER ) && !defined( __linux__ ) +// bk001120 - presumably needed for Mac +//#if !defined ( _MSC_VER ) && ! defined ( __linux__ ) + +// bk001127 - undid undo +#if defined ( Q3_VM ) int atoi( const char *string ) { int sign; diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index ba21ca43..89a8d6ba 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3282,8 +3282,16 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const pla } return qtrue;*/ - case IT_BAD: - Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" ); + case IT_BAD: + Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" ); + + default: +#ifndef Q3_VM +#ifndef NDEBUG // bk0001204 + Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType ); +#endif +#endif + break; } return qfalse; @@ -3612,7 +3620,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean if ( ps->entityEventSequence < ps->eventSequence - MAX_PS_EVENTS) { ps->entityEventSequence = ps->eventSequence - MAX_PS_EVENTS; } - seq = (ps->entityEventSequence-1) & (MAX_PS_EVENTS-1); + seq = ps->entityEventSequence & (MAX_PS_EVENTS-1); s->event = ps->events[ seq ] | ( ( ps->entityEventSequence & 3 ) << 8 ); s->eventParm = ps->eventParms[ seq ]; ps->entityEventSequence++; @@ -3709,7 +3717,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s if ( ps->entityEventSequence < ps->eventSequence - MAX_PS_EVENTS) { ps->entityEventSequence = ps->eventSequence - MAX_PS_EVENTS; } - seq = (ps->entityEventSequence-1) & (MAX_PS_EVENTS-1); + seq = ps->entityEventSequence & (MAX_PS_EVENTS-1); s->event = ps->events[ seq ] | ( ( ps->entityEventSequence & 3 ) << 8 ); s->eventParm = ps->eventParms[ seq ]; ps->entityEventSequence++; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 0860b5e2..a67d516f 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -101,8 +101,9 @@ #define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) #define CS_PRECACHES (CS_PLAYERS+MAX_CLIENTS) #define CS_LOCATIONS (CS_PRECACHES+MAX_CLIENTS) +#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) -#define CS_MAX (CS_LOCATIONS+MAX_LOCATIONS) +#define CS_MAX (CS_PARTICLES+MAX_LOCATIONS) #if (CS_MAX) > MAX_CONFIGSTRINGS #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS @@ -206,7 +207,10 @@ typedef struct { // callbacks to test the world // these will be different functions during game and cgame + /*void (*trace)( trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask );*/ void (*trace)( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask ); + + int (*pointcontents)( const vec3_t point, int passEntityNum ); } pmove_t; @@ -283,6 +287,7 @@ typedef enum { #define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD #define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes #define EF_AWARD_EXCELLENT 0x00000008 // draw an excellent sprite +#define EF_PLAYER_EVENT 0x00000010 #define EF_BOUNCE 0x00000010 // for missiles #define EF_BOUNCE_HALF 0x00000020 // for missiles #define EF_AWARD_GAUNTLET 0x00000040 // draw a gauntlet sprite @@ -427,6 +432,8 @@ typedef enum #define EV_EVENT_BIT2 0x00000200 #define EV_EVENT_BITS (EV_EVENT_BIT1|EV_EVENT_BIT2) +#define EVENT_VALID_MSEC 300 + typedef enum { EV_NONE, @@ -595,14 +602,12 @@ typedef enum { LEGS_TURN, -#ifdef NEW_ANIMS TORSO_GETFLAG, TORSO_GUARDBASE, TORSO_PATROL, TORSO_FOLLOWME, TORSO_AFFIRMATIVE, TORSO_NEGATIVE, -#endif MAX_PLAYER_ANIMATIONS, diff --git a/src/game/bg_slidemove.c b/src/game/bg_slidemove.c index f0791ed3..c53d0fe0 100644 --- a/src/game/bg_slidemove.c +++ b/src/game/bg_slidemove.c @@ -241,6 +241,7 @@ void PM_StepSlideMove( qboolean gravity ) { // float down_dist, up_dist; // vec3_t delta, delta2; vec3_t up, down; + float stepSize; VectorCopy (pm->ps->origin, start_o); VectorCopy (pm->ps->velocity, start_v); @@ -266,7 +267,7 @@ void PM_StepSlideMove( qboolean gravity ) { up[2] += STEPSIZE; // test the player position if they were a stepheight higher - pm->trace (&trace, up, pm->mins, pm->maxs, up, pm->ps->clientNum, pm->tracemask); + pm->trace (&trace, start_o, pm->mins, pm->maxs, up, pm->ps->clientNum, pm->tracemask); if ( trace.allsolid ) { if ( pm->debugLevel ) { Com_Printf("%i:bend can't step\n", c_pmove); @@ -274,8 +275,9 @@ void PM_StepSlideMove( qboolean gravity ) { return; // can't step up } + stepSize = trace.endpos[2] - start_o[2]; // try slidemove from this position - VectorCopy (up, pm->ps->origin); + VectorCopy (trace.endpos, pm->ps->origin); VectorCopy (start_v, pm->ps->velocity); PM_SlideMove( gravity ); diff --git a/src/game/g_active.c b/src/game/g_active.c index ca7552a3..2a9e27fb 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -677,6 +677,41 @@ static int StuckInOtherClient(gentity_t *ent) { /* ============== +SendPendingPredictableEvents +============== +*/ +void SendPendingPredictableEvents( playerState_t *ps ) { + gentity_t *t; + int event, seq; + int extEvent, number; + + // if there are still events pending + if ( ps->entityEventSequence < ps->eventSequence ) { + // create a temporary entity for this event which is sent to everyone + // except the client who generated the event + seq = ps->entityEventSequence & (MAX_PS_EVENTS-1); + event = ps->events[ seq ] | ( ( ps->entityEventSequence & 3 ) << 8 ); + // set external event to zero before calling BG_PlayerStateToEntityState + extEvent = ps->externalEvent; + ps->externalEvent = 0; + // create temporary entity for event + t = G_TempEntity( ps->origin, event ); + number = t->s.number; + BG_PlayerStateToEntityState( ps, &t->s, qtrue ); + t->s.number = number; + t->s.eType = ET_EVENTS + event; + t->s.eFlags |= EF_PLAYER_EVENT; + t->s.otherEntityNum = ps->clientNum; + // send to everyone except the client who generated the event + t->r.svFlags |= SVF_NOTSINGLECLIENT; + t->r.singleClient = ps->clientNum; + // set back external event + ps->externalEvent = extEvent; + } +} + +/* +============== ClientThink This will be called once for each client frame, which will @@ -927,6 +962,8 @@ void ClientThink_real( gentity_t *ent ) { else { BG_PlayerStateToEntityState( &ent->client->ps, &ent->s, qtrue ); } + SendPendingPredictableEvents( &ent->client->ps ); + if( !( ent->client->ps.eFlags & EF_FIRING ) ) client->fireHeld = qfalse; // for grapple if( !( ent->client->ps.eFlags & EF_FIRING2 ) ) @@ -1163,6 +1200,7 @@ void ClientEndFrame( gentity_t *ent ) { else { BG_PlayerStateToEntityState( &ent->client->ps, &ent->s, qtrue ); } + SendPendingPredictableEvents( &ent->client->ps ); // set the bit for the reachability area the client is currently in // i = trap_AAS_PointReachabilityAreaIndex( ent->client->ps.origin ); diff --git a/src/game/g_client.c b/src/game/g_client.c index 38afac43..17928cc3 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -840,6 +840,7 @@ ForceClientSkin Forces a client's skin (for teamplay) =========== */ +/* static void ForceClientSkin( gclient_t *client, char *model, const char *skin ) { char *p; @@ -850,7 +851,7 @@ static void ForceClientSkin( gclient_t *client, char *model, const char *skin ) Q_strcat(model, MAX_QPATH, "/"); Q_strcat(model, MAX_QPATH, skin); } - +*/ /* =========== @@ -954,6 +955,7 @@ void ClientUserinfoChanged( int clientNum ) { char oldname[MAX_STRING_CHARS]; gclient_t *client; char c1[MAX_INFO_STRING]; + char c2[MAX_INFO_STRING]; char redTeam[MAX_INFO_STRING]; char blueTeam[MAX_INFO_STRING]; char userinfo[MAX_INFO_STRING]; @@ -1015,20 +1017,21 @@ void ClientUserinfoChanged( int clientNum ) { s = BG_FindModelNameForClass( client->pers.pclass ); Q_strncpyz( model, s, sizeof( model ) ); +/* // team switch( client->sess.sessionTeam ) { case TEAM_HUMANS: - ForceClientSkin(client, model, "red"); + //ForceClientSkin(client, model, "red"); break; case TEAM_DROIDS: - ForceClientSkin(client, model, "blue"); + //ForceClientSkin(client, model, "blue"); break; } if ( g_gametype.integer >= GT_TEAM && client->sess.sessionTeam == TEAM_SPECTATOR ) { // don't ever use a default skin in teamplay, it would just waste memory - ForceClientSkin(client, model, "red"); + //ForceClientSkin(client, model, "red"); } - +*/ // teamInfo @@ -1045,20 +1048,21 @@ void ClientUserinfoChanged( int clientNum ) { teamLeader = client->sess.teamLeader; // colors - strcpy(c1, Info_ValueForKey( userinfo, "color" )); + strcpy(c1, Info_ValueForKey( userinfo, "color1" )); + strcpy(c2, Info_ValueForKey( userinfo, "color2" )); strcpy(redTeam, "humans"); strcpy(blueTeam, "droids"); // send over a subset of the userinfo keys so other clients can // print scoreboards, display models, and play custom sounds if ( ent->r.svFlags & SVF_BOT ) { - s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\c1\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d", - client->pers.netname, client->sess.sessionTeam, model, model, c1, + s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d", + client->pers.netname, client->sess.sessionTeam, model, model, c1, c2, client->pers.maxHealth, client->sess.wins, client->sess.losses, Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader ); } else { - s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d", - client->pers.netname, client->sess.sessionTeam, model, model, redTeam, blueTeam, c1, + s = va("n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d", + client->pers.netname, client->sess.sessionTeam, model, model, redTeam, blueTeam, c1, c2, client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader); } @@ -1243,7 +1247,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) { int ammoIndex, ammoSubIndex; int teamLocal; int accuracy_hits, accuracy_shots; - int savedEvents[MAX_PS_EVENTS]; int eventSequence; char userinfo[MAX_INFO_STRING]; vec3_t bodyMaxs, classMins, up = { 0, 0, 1 }; @@ -1322,10 +1325,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) { for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) { persistant[i] = client->ps.persistant[i]; } - // also save the predictable events otherwise we might get double or dropped events - for (i = 0; i < MAX_PS_EVENTS; i++) { - savedEvents[i] = client->ps.events[i]; - } eventSequence = client->ps.eventSequence; memset (client, 0, sizeof(*client)); @@ -1338,9 +1337,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) { for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) { client->ps.persistant[i] = persistant[i]; } - for (i = 0; i < MAX_PS_EVENTS; i++) { - client->ps.events[i] = savedEvents[i]; - } client->ps.eventSequence = eventSequence; if( client->sess.sessionTeam == TEAM_SPECTATOR ) diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index bba155fc..ca4cc109 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -756,6 +756,9 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons if (!other->client) { return; } + if ( other->client->pers.connected != CON_CONNECTED ) { + return; + } if ( mode == SAY_TEAM && !OnSameTeam(ent, other) ) { return; } diff --git a/src/game/g_local.h b/src/game/g_local.h index 6404e6b6..1a5c96e6 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -38,7 +38,6 @@ #define INFINITE 1000000 #define FRAMETIME 100 // msec -#define EVENT_VALID_MSEC 300 #define CARNAGE_REWARD_TIME 3000 #define REWARD_SPRITE_TIME 2000 @@ -380,7 +379,7 @@ typedef struct armourRegion_s // this structure is cleared as each map is entered // #define MAX_SPAWN_VARS 64 -#define MAX_SPAWN_VARS_CHARS 2048 +#define MAX_SPAWN_VARS_CHARS 4096 typedef struct { struct gclient_s *clients; // [maxclients] diff --git a/src/game/g_main.c b/src/game/g_main.c index 3d5fb1e8..06505ce5 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -87,7 +87,7 @@ vmCvar_t g_rankings; vmCvar_t g_listEntity; -cvarTable_t gameCvarTable[] = { +static cvarTable_t gameCvarTable[] = { // don't override the cheat state set by the system { &g_cheats, "sv_cheats", "", 0, 0, qfalse }, @@ -98,7 +98,8 @@ cvarTable_t gameCvarTable[] = { { NULL, "sv_mapname", "", CVAR_SERVERINFO | CVAR_ROM, 0, qfalse }, // latched vars - { &g_gametype, "g_gametype", "0", CVAR_SERVERINFO | CVAR_LATCH, 0, qfalse }, + { &g_gametype, "g_gametype", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse }, + { &g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, { &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse }, @@ -157,7 +158,7 @@ cvarTable_t gameCvarTable[] = { { &g_rankings, "g_rankings", "0", 0, 0, qfalse} }; -int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[0] ); +static int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[0] ); void G_InitGame( int levelTime, int randomSeed, int restart ); @@ -1212,7 +1213,9 @@ Append information about this game to the log file void LogExit( const char *string ) { int i, numSorted; gclient_t *cl; +#ifdef MISSIONPACK // bk001205 qboolean won = qtrue; +#endif G_LogPrintf( "Exit: %s\n", string ); diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 6508d357..a874d5b0 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -197,8 +197,14 @@ void locateCamera( gentity_t *ent ) { ent->s.frame = 75; } - // set to 0 for no rotation at all - ent->s.powerups = 1; + // swing camera ? + if ( owner->spawnflags & 4 ) { + // set to 0 for no rotation at all + ent->s.powerups = 0; + } + else { + ent->s.powerups = 1; + } // clientNum holds the rotate offset ent->s.clientNum = owner->s.clientNum; @@ -237,7 +243,8 @@ void SP_misc_portal_surface(gentity_t *ent) { } } -/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate +/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate noswing + The target for a misc_portal_director. You can set either angles or target another entity to determine the direction of view. "roll" an angle modifier to orient the camera around the target vector; */ diff --git a/src/game/g_mover.c b/src/game/g_mover.c index b4cd4b45..bbc03db6 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -75,6 +75,43 @@ gentity_t *G_TestEntityPosition( gentity_t *ent ) { return NULL; } +/* +================ +G_CreateRotationMatrix +================ +*/ +void G_CreateRotationMatrix(vec3_t angles, vec3_t matrix[3]) { + AngleVectors(angles, matrix[0], matrix[1], matrix[2]); + VectorInverse(matrix[1]); +} + +/* +================ +G_TransposeMatrix +================ +*/ +void G_TransposeMatrix(vec3_t matrix[3], vec3_t transpose[3]) { + int i, j; + for (i = 0; i < 3; i++) { + for (j = 0; j < 3; j++) { + transpose[i][j] = matrix[j][i]; + } + } +} + +/* +================ +G_RotatePoint +================ +*/ +void G_RotatePoint(vec3_t point, vec3_t matrix[3]) { + vec3_t tvec; + + VectorCopy(point, tvec); + point[0] = DotProduct(matrix[0], tvec); + point[1] = DotProduct(matrix[1], tvec); + point[2] = DotProduct(matrix[2], tvec); +} /* ================== @@ -84,7 +121,7 @@ Returns qfalse if the move is blocked ================== */ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, vec3_t amove ) { - vec3_t forward, right, up; + vec3_t matrix[3], transpose[3]; vec3_t org, org2, move2; gentity_t *block; @@ -108,28 +145,28 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, } pushed_p++; - // we need this for pushing things later - VectorSubtract (vec3_origin, amove, org); - AngleVectors (org, forward, right, up); - - // try moving the contacted entity - VectorAdd (check->s.pos.trBase, move, check->s.pos.trBase); - if (check->client) { - // make sure the client's view rotates when on a rotating mover - check->client->ps.delta_angles[YAW] += ANGLE2SHORT(amove[YAW]); - } - - // figure movement due to the pusher's amove - VectorSubtract (check->s.pos.trBase, pusher->r.currentOrigin, org); - org2[0] = DotProduct (org, forward); - org2[1] = -DotProduct (org, right); - org2[2] = DotProduct (org, up); - VectorSubtract (org2, org, move2); - VectorAdd (check->s.pos.trBase, move2, check->s.pos.trBase); - if ( check->client ) { - VectorAdd (check->client->ps.origin, move, check->client->ps.origin); - VectorAdd (check->client->ps.origin, move2, check->client->ps.origin); - } + // try moving the contacted entity + // figure movement due to the pusher's amove + G_CreateRotationMatrix( amove, transpose ); + G_TransposeMatrix( transpose, matrix ); + if ( check->client ) { + VectorSubtract (check->client->ps.origin, pusher->r.currentOrigin, org); + } + else { + VectorSubtract (check->s.pos.trBase, pusher->r.currentOrigin, org); + } + VectorCopy( org, org2 ); + G_RotatePoint( org2, matrix ); + VectorSubtract (org2, org, move2); + // add movement + VectorAdd (check->s.pos.trBase, move, check->s.pos.trBase); + VectorAdd (check->s.pos.trBase, move2, check->s.pos.trBase); + if ( check->client ) { + VectorAdd (check->client->ps.origin, move, check->client->ps.origin); + VectorAdd (check->client->ps.origin, move2, check->client->ps.origin); + // make sure the client's view rotates when on a rotating mover + check->client->ps.delta_angles[YAW] += ANGLE2SHORT(amove[YAW]); + } // may have pushed them off an edge if ( check->s.groundEntityNum != pusher->s.number ) { diff --git a/src/game/g_public.h b/src/game/g_public.h index 87b3800b..28456f3b 100644 --- a/src/game/g_public.h +++ b/src/game/g_public.h @@ -39,7 +39,13 @@ #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 // for link position (missiles and movers) -#define SVF_SINGLECLIENT 0x00000100 // only send to a single client +#define SVF_SINGLECLIENT 0x00000100 // only send to a single client (entityShared_t->singleClient) +#define SVF_NOSERVERINFO 0x00000200 // don't send CS_SERVERINFO updates to this client + // so that it can be updated for ping tools without + // lagging clients +#define SVF_CAPSULE 0x00000400 // use capsule for collision detection instead of bbox +#define SVF_NOTSINGLECLIENT 0x00000800 // send entity to everyone but one client + // (entityShared_t->singleClient) //=============================================================== @@ -211,6 +217,9 @@ typedef enum { G_REAL_TIME, G_SNAPVECTOR, + G_TRACECAPSULE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask ); + G_ENTITY_CONTACTCAPSULE, // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent ); + BOTLIB_SETUP = 200, // ( void ); BOTLIB_SHUTDOWN, // ( void ); BOTLIB_LIBVAR_SET, diff --git a/src/game/g_session.c b/src/game/g_session.c index ce93b4d5..7695c96e 100644 --- a/src/game/g_session.c +++ b/src/game/g_session.c @@ -75,18 +75,28 @@ void G_ReadSessionData( gclient_t *client ) { char s[MAX_STRING_CHARS]; const char *var; + // bk001205 - format + int teamLeader; + int spectatorState; + int sessionTeam; + var = va( "session%i", client - level.clients ); trap_Cvar_VariableStringBuffer( var, s, sizeof(s) ); sscanf( s, "%i %i %i %i %i %i %i", - &client->sess.sessionTeam, + &sessionTeam, &client->sess.spectatorTime, - &client->sess.spectatorState, + &spectatorState, &client->sess.spectatorClient, &client->sess.wins, &client->sess.losses, - &client->sess.teamLeader + &teamLeader ); + + // bk001205 - format issues + client->sess.sessionTeam = (team_t)sessionTeam; + client->sess.spectatorState = (spectatorState_t)spectatorState; + client->sess.teamLeader = (qboolean)teamLeader; } diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 8bb3f39f..8f74a4ee 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -195,8 +195,6 @@ void SP_team_CTF_blueplayer( gentity_t *ent ); void SP_team_CTF_redspawn( gentity_t *ent ); void SP_team_CTF_bluespawn( gentity_t *ent ); -void SP_item_botroam( gentity_t *ent ) {}; - spawn_t spawns[] = { // info entities don't do anything at all, but provide positional // information for things controlled by other processes @@ -268,8 +266,6 @@ spawn_t spawns[] = { {"team_CTF_redspawn", SP_team_CTF_redspawn}, {"team_CTF_bluespawn", SP_team_CTF_bluespawn}, - {"item_botroam", SP_item_botroam}, - {0, 0} }; @@ -449,6 +445,12 @@ void G_SpawnGEntityFromSpawnVars( void ) { } } + G_SpawnInt( "notq3a", "0", &i ); + if ( i ) { + G_FreeEntity( ent ); + return; + } + if( G_SpawnString( "gametype", NULL, &value ) ) { if( g_gametype.integer >= GT_FFA && g_gametype.integer < GT_MAX_GAME_TYPE ) { gametypeName = gametypeNames[g_gametype.integer]; @@ -484,7 +486,8 @@ char *G_AddSpawnVarToken( const char *string ) { l = strlen( string ); if ( level.numSpawnVarChars + l + 1 > MAX_SPAWN_VARS_CHARS ) { - G_Error( "G_AddSpawnVarToken: MAX_SPAWN_VARS" ); + G_Error( "G_AddSpawnVarToken: MAX_SPAWN_CHARS" ); + } dest = level.spawnVarChars + level.numSpawnVarChars; diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c index f74c2e56..21eafeed 100644 --- a/src/game/g_svcmds.c +++ b/src/game/g_svcmds.c @@ -469,7 +469,7 @@ qboolean ConsoleCommand( void ) { } if (Q_stricmp (cmd, "listip") == 0) { - trap_SendConsoleCommand( EXEC_INSERT, "g_banIPs\n" ); + trap_SendConsoleCommand( EXEC_NOW, "g_banIPs\n" ); return qtrue; } diff --git a/src/game/g_syscalls.asm b/src/game/g_syscalls.asm index 2d9c4f89..e997e293 100644 --- a/src/game/g_syscalls.asm +++ b/src/game/g_syscalls.asm @@ -43,6 +43,8 @@ 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 memset -101 @@ -215,3 +217,8 @@ equ trap_AAS_AlternativeRouteGoals -576 equ trap_AAS_PredictRoute -577 equ trap_AAS_PointReachabilityAreaIndex -578 +equ trap_BotLibLoadSource -579 +equ trap_BotLibFreeSource -580 +equ trap_BotLibReadToken -581 +equ trap_BotLibSourceFileAndLine -582 + diff --git a/src/game/g_syscalls.c b/src/game/g_syscalls.c index c08295d8..00b9477d 100644 --- a/src/game/g_syscalls.c +++ b/src/game/g_syscalls.c @@ -148,6 +148,10 @@ void trap_Trace( trace_t *results, const vec3_t start, const vec3_t mins, const syscall( G_TRACE, results, start, mins, maxs, end, passEntityNum, contentmask ); } +void trap_TraceCapsule( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask ) { + syscall( G_TRACECAPSULE, results, start, mins, maxs, end, passEntityNum, contentmask ); +} + int trap_PointContents( const vec3_t point, int passEntityNum ) { return syscall( G_POINT_CONTENTS, point, passEntityNum ); } @@ -186,6 +190,9 @@ qboolean trap_EntityContact( const vec3_t mins, const vec3_t maxs, const gentity return syscall( G_ENTITY_CONTACT, mins, maxs, ent ); } +qboolean trap_EntityContactCapsule( const vec3_t mins, const vec3_t maxs, const gentity_t *ent ) { + return syscall( G_ENTITY_CONTACTCAPSULE, mins, maxs, ent ); +} int trap_BotAllocateClient( void ) { return syscall( G_BOT_ALLOCATE_CLIENT ); } @@ -763,3 +770,19 @@ void trap_BotResetWeaponState(int weaponstate) { int trap_GeneticParentsAndChildSelection(int numranks, float *ranks, int *parent1, int *parent2, int *child) { return syscall( BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION, numranks, ranks, parent1, parent2, child ); } + +int trap_PC_LoadSource( const char *filename ) { + return syscall( BOTLIB_PC_LOAD_SOURCE, filename ); +} + +int trap_PC_FreeSource( int handle ) { + return syscall( BOTLIB_PC_FREE_SOURCE, handle ); +} + +int trap_PC_ReadToken( int handle, pc_token_t *pc_token ) { + return syscall( BOTLIB_PC_READ_TOKEN, handle, pc_token ); +} + +int trap_PC_SourceFileAndLine( int handle, char *filename, int *line ) { + return syscall( BOTLIB_PC_SOURCE_FILE_AND_LINE, handle, filename, line ); +} diff --git a/src/game/g_team.c b/src/game/g_team.c index ce9263d1..528e82a4 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -703,7 +703,7 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) { AddScore (player, CTF_RETURN_FLAG_ASSIST_BONUS); other->client->pers.teamState.assists++; } - if (player->client->pers.teamState.lastfraggedcarrier + + else if (player->client->pers.teamState.lastfraggedcarrier + CTF_FRAG_CARRIER_ASSIST_TIMEOUT > level.time) { AddScore(player, CTF_FRAG_CARRIER_ASSIST_BONUS); other->client->pers.teamState.assists++; diff --git a/src/game/g_utils.c b/src/game/g_utils.c index a72f57ad..07d0adf4 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -59,7 +59,7 @@ void AddRemap(const char *oldShader, const char *newShader, float timeOffset) { } const char *BuildShaderStateConfig() { - static char buff[MAX_STRING_CHARS]; + static char buff[MAX_STRING_CHARS*4]; char out[(MAX_QPATH * 2) + 5]; int i; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 7a9c7779..3532e3d0 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -32,7 +32,7 @@ static vec3_t forward, right, up; static vec3_t muzzle; -#define NUM_NAILSHOTS 10 +#define NUM_NAILSHOTS 15 /* ================ diff --git a/src/game/q_shared.h b/src/game/q_shared.h index 6faaced2..26678db0 100644 --- a/src/game/q_shared.h +++ b/src/game/q_shared.h @@ -1198,7 +1198,7 @@ typedef enum _flag_status { #define MAX_GLOBAL_SERVERS 2048 #define MAX_OTHER_SERVERS 128 -#define MAX_PINGREQUESTS 16 +#define MAX_PINGREQUESTS 32 #define MAX_SERVERSTATUSREQUESTS 16 #define SAY_ALL 0 |