summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-26 02:54:21 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-26 02:54:21 +0200
commit7a9d256ea39e7ed8797801f8184e6ab7f27a21dc (patch)
tree60717f0117b2b696693efa0e7070c58ea266cdcf /src/cgame
parentb28d5f6dbedd5b895eed4cc5b730581df3b2215d (diff)
Bug fixes for Wraith.
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_event.c67
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c1
-rw-r--r--src/cgame/cg_players.c12
-rw-r--r--src/cgame/cg_scanner.c5
5 files changed, 60 insertions, 26 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 2ff1520..c1d4ee8 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -620,6 +620,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
int clientNum;
clientInfo_t *ci;
int steptime;
+ qboolean warpingEnemyWraith = qfalse;
if( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT )
steptime = 200;
@@ -642,13 +643,20 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
ci = &cgs.clientinfo[ clientNum ];
+ if( ci->team != cg.snap->ps.stats[ STAT_TEAM ] &&
+ ( es->eFlags & EF_WARPING ) )
+ {
+ warpingEnemyWraith = qtrue;
+ }
+
switch( event )
{
//
// movement generated events
//
case EV_FOOTSTEP:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
if( ci->footsteps == FOOTSTEP_CUSTOM )
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -660,7 +668,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSTEP_METAL:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
if( ci->footsteps == FOOTSTEP_CUSTOM )
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -672,7 +681,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSTEP_SQUELCH:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_FLESH ][ rand( ) & 3 ] );
@@ -680,7 +690,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSPLASH:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] );
@@ -688,7 +699,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTWADE:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] );
@@ -696,7 +708,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_SWIM:
- if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
+ if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE &&
+ !warpingEnemyWraith )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][ rand( ) & 3 ] );
@@ -794,33 +807,35 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
}
case EV_JUMP:
- trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) );
-
- if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_WALLJUMPER ) )
+ if( !warpingEnemyWraith )
{
- vec3_t surfNormal, refNormal = { 0.0f, 0.0f, 1.0f };
- vec3_t is;
+ trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) );
- if( clientNum != cg.predictedPlayerState.clientNum )
- break;
+ if( BG_ClassHasAbility( cg.predictedPlayerState.stats[ STAT_CLASS ], SCA_WALLJUMPER ) )
+ {
+ vec3_t surfNormal, refNormal = { 0.0f, 0.0f, 1.0f };
+ vec3_t is;
- //set surfNormal
- VectorCopy( cg.predictedPlayerState.grapplePoint, surfNormal );
+ if( clientNum != cg.predictedPlayerState.clientNum )
+ break;
- //if we are moving from one surface to another smooth the transition
- if( !VectorCompare( surfNormal, cg.lastNormal ) && surfNormal[ 2 ] != 1.0f )
- {
- CrossProduct( refNormal, surfNormal, is );
- VectorNormalize( is );
+ //set surfNormal
+ VectorCopy( cg.predictedPlayerState.grapplePoint, surfNormal );
- //add the op
- CG_addSmoothOp( is, 15.0f, 1.0f );
- }
+ //if we are moving from one surface to another smooth the transition
+ if( !VectorCompare( surfNormal, cg.lastNormal ) && surfNormal[ 2 ] != 1.0f )
+ {
+ CrossProduct( refNormal, surfNormal, is );
+ VectorNormalize( is );
- //copy the current normal to the lastNormal
- VectorCopy( surfNormal, cg.lastNormal );
- }
+ //add the op
+ CG_addSmoothOp( is, 15.0f, 1.0f );
+ }
+ //copy the current normal to the lastNormal
+ VectorCopy( surfNormal, cg.lastNormal );
+ }
+ }
break;
case EV_AIRPOUNCE:
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 9a4793c..5b8f8b0 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1361,6 +1361,7 @@ typedef struct
sfxHandle_t warpingSound;
qhandle_t warpOverlay;
qhandle_t warpOverlayBlocked;
+ qhandle_t warpingShader;
} cgMedia_t;
typedef struct
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index c224171..2fae20f 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -938,6 +938,7 @@ static void CG_RegisterGraphics( void )
cgs.media.warpExitPS = CG_RegisterParticleSystem( "gfx/level1/warpExitPS" );
cgs.media.warpOverlay = trap_R_RegisterShader( "gfx/level1/warpOverlay" );
cgs.media.warpOverlayBlocked = trap_R_RegisterShader( "gfx/level1/warpOverlayBlocked" );
+ cgs.media.warpingShader = trap_R_RegisterShader( "gfx/level1/warping" );
CG_BuildableStatusParse( "ui/assets/human/buildstat.cfg", &cgs.humanBuildStat );
CG_BuildableStatusParse( "ui/assets/alien/buildstat.cfg", &cgs.alienBuildStat );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index e0bb622..8da8757 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1897,6 +1897,13 @@ void CG_Player( centity_t *cent )
if( es->eFlags & EF_NODRAW )
return;
+ if( ( es->eFlags & EF_WARPING ) &&
+ ( cgs.clientinfo[ es->number ].team != cg.snap->ps.stats[ STAT_TEAM ] ||
+ cg.snap->ps.stats[ STAT_TEAM ] == TEAM_NONE ) )
+ {
+ return;
+ }
+
// get the player model information
renderfx = 0;
if( es->number == cg.snap->ps.clientNum )
@@ -2060,6 +2067,11 @@ void CG_Player( centity_t *cent )
VectorCopy( legs.origin, legs.lightingOrigin );
VectorCopy( legs.origin, legs.oldorigin ); // don't positionally lerp at all
+ if( es->eFlags & EF_WARPING )
+ {
+ legs.customShader = cgs.media.warpingShader;
+ }
+
trap_R_AddRefEntityToScene( &legs );
// if the model failed, allow the default nullmodel to be displayed
diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c
index 6659b98..5e134cd 100644
--- a/src/cgame/cg_scanner.c
+++ b/src/cgame/cg_scanner.c
@@ -58,6 +58,11 @@ void CG_UpdateEntityPositions( void )
{
cent = &cg_entities[ cg.snap->entities[ i ].number ];
+ if( cent->currentState.eFlags & EF_NODRAW )
+ {
+ continue;
+ }
+
if( cent->currentState.eType == ET_BUILDABLE &&
!( cent->currentState.eFlags & EF_DEAD ))
{