summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_ents.c35
-rw-r--r--src/cgame/cg_local.h3
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/cgame/cg_players.c18
-rw-r--r--src/game/bg_pmove.c11
5 files changed, 65 insertions, 4 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 682d8aad..c4b7ecc9 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -1112,5 +1112,40 @@ void CG_AddPacketEntities( void )
CG_AddCEntity( cent );
}
+ //make an attempt at drawing bounding boxes of selected entity types
+ if( cg_drawBBOX.integer )
+ {
+ for( num = 0; num < cg.snap->numEntities; num++ )
+ {
+ float x, zd, zu;
+ vec3_t mins, maxs;
+ entityState_t *es;
+
+ cent = &cg_entities[ cg.snap->entities[ num ].number ];
+ es = &cent->currentState;
+
+ switch( es->eType )
+ {
+ case ET_PLAYER:
+ case ET_BUILDABLE:
+ case ET_MISSILE:
+ case ET_CORPSE:
+ x = ( es->solid & 255 );
+ zd = ( ( es->solid >> 8 ) & 255 );
+ zu = ( ( es->solid >> 16 ) & 255 ) - 32;
+
+ mins[ 0 ] = mins[ 1 ] = -x;
+ maxs[ 0 ] = maxs[ 1 ] = x;
+ mins[ 2 ] = -zd;
+ maxs[ 2 ] = zu;
+
+ CG_DrawBoundingBox( es->origin, mins, maxs );
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
}
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index ccd8789e..40644e84 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -394,6 +394,8 @@ typedef struct
float barrelAngle;
int barrelTime;
qboolean barrelSpinning;
+
+ vec3_t lastNormal;
} playerEntity_t;
typedef struct lightFlareStatus_s
@@ -1410,6 +1412,7 @@ extern vmCvar_t cg_oldPlasma;
extern vmCvar_t cg_trueLightning;
extern vmCvar_t cg_creepRes;
extern vmCvar_t cg_drawSurfNormal;
+extern vmCvar_t cg_drawBBOX;
extern vmCvar_t cg_debugAlloc;
extern vmCvar_t cg_wwSmoothTime;
extern vmCvar_t cg_wwFollow;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index da6b5cba..ee007318 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -190,6 +190,7 @@ vmCvar_t cg_oldPlasma;
vmCvar_t cg_trueLightning;
vmCvar_t cg_creepRes;
vmCvar_t cg_drawSurfNormal;
+vmCvar_t cg_drawBBOX;
vmCvar_t cg_debugAlloc;
vmCvar_t cg_wwSmoothTime;
vmCvar_t cg_wwFollow;
@@ -289,6 +290,7 @@ static cvarTable_t cvarTable[ ] =
{ &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE },
{ &cg_creepRes, "cg_creepRes", "16", CVAR_ARCHIVE },
{ &cg_drawSurfNormal, "cg_drawSurfNormal", "0", CVAR_CHEAT },
+ { &cg_drawBBOX, "cg_drawBBOX", "0", CVAR_CHEAT },
{ &cg_debugAlloc, "cg_debugAlloc", "0", 0 },
{ &cg_wwSmoothTime, "cg_wwSmoothTime", "300", CVAR_ARCHIVE },
{ &cg_wwFollow, "cg_wwFollow", "1", CVAR_ARCHIVE|CVAR_USERINFO },
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 60d76253..8c7711d8 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1320,12 +1320,30 @@ static void CG_PlayerNonSegAngles( centity_t *cent, vec3_t srcAngles, vec3_t non
float speed;
int dir, clientNum;
clientInfo_t *ci;
+ entityState_t *es = &cent->currentState;
+ vec3_t surfNormal;
+ vec3_t ceilingNormal = { 0.0f, 0.0f, -1.0f };
VectorCopy( srcAngles, localAngles );
localAngles[ YAW ] = AngleMod( localAngles[ YAW ] );
localAngles[ PITCH ] = 0.0f;
localAngles[ ROLL ] = 0.0f;
+ //set surfNormal
+ if( !( es->eFlags & EF_WALLCLIMBCEILING ) )
+ VectorCopy( es->angles2, surfNormal );
+ else
+ VectorCopy( ceilingNormal, surfNormal );
+
+ //make sure that WW transitions don't cause the swing stuff to go nuts
+ if( !VectorCompare( surfNormal, cent->pe.lastNormal ) )
+ {
+ VectorCopy( surfNormal, cent->pe.lastNormal );
+
+ cent->pe.nonseg.yawAngle = localAngles[ YAW ];
+ cent->pe.nonseg.yawing = qfalse;
+ }
+
// --------- yaw -------------
// allow yaw to drift a bit
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index b90db531..4f8fe643 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2984,10 +2984,13 @@ static void PM_Animate( void )
}
else
{
- PM_ForceLegsAnim( NSPA_GESTURE );
- pm->ps->torsoTimer = TIMER_GESTURE;
-
- PM_AddEvent( EV_TAUNT );
+ if( pm->ps->torsoTimer == 0 )
+ {
+ PM_ForceLegsAnim( NSPA_GESTURE );
+ pm->ps->torsoTimer = TIMER_GESTURE;
+
+ PM_AddEvent( EV_TAUNT );
+ }
}
}
}