summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_event.c70
1 files changed, 2 insertions, 68 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 8acbbeaf..7bc50929 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -508,7 +508,6 @@ An entity has an event value
also called by CG_CheckPlayerstateEvents
==============
*/
-#define DEBUGNAME(x) if(cg_debugEvents.integer){CG_Printf(x"\n");}
void CG_EntityEvent( centity_t *cent, vec3_t position )
{
entityState_t *es;
@@ -528,13 +527,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
event = es->event & ~EV_EVENT_BITS;
if( cg_debugEvents.integer )
- CG_Printf( "ent:%3i event:%3i ", es->number, event );
+ CG_Printf( "ent:%3i event:%3i %s\n", es->number, event,
+ BG_EventName( event ) );
if( !event )
- {
- DEBUGNAME("ZEROEVENT");
return;
- }
clientNum = es->clientNum;
if( clientNum < 0 || clientNum >= MAX_CLIENTS )
@@ -548,7 +545,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
// movement generated events
//
case EV_FOOTSTEP:
- DEBUGNAME( "EV_FOOTSTEP" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
if( ci->footsteps == FOOTSTEP_CUSTOM )
@@ -561,7 +557,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSTEP_METAL:
- DEBUGNAME( "EV_FOOTSTEP_METAL" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
if( ci->footsteps == FOOTSTEP_CUSTOM )
@@ -574,7 +569,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSTEP_SQUELCH:
- DEBUGNAME( "EV_FOOTSTEP_SQUELCH" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -583,7 +577,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTSPLASH:
- DEBUGNAME( "EV_FOOTSPLASH" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -592,7 +585,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FOOTWADE:
- DEBUGNAME( "EV_FOOTWADE" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -601,7 +593,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_SWIM:
- DEBUGNAME( "EV_SWIM" );
if( cg_footsteps.integer && ci->footsteps != FOOTSTEP_NONE )
{
trap_S_StartSound( NULL, es->number, CHAN_BODY,
@@ -611,7 +602,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
case EV_FALL_SHORT:
- DEBUGNAME( "EV_FALL_SHORT" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.landSound );
if( clientNum == cg.predictedPlayerState.clientNum )
@@ -623,7 +613,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FALL_MEDIUM:
- DEBUGNAME( "EV_FALL_MEDIUM" );
// use normal pain sound
trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*pain100_1.wav" ) );
@@ -636,7 +625,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FALL_FAR:
- DEBUGNAME( "EV_FALL_FAR" );
trap_S_StartSound (NULL, es->number, CHAN_AUTO, CG_CustomSound( es->number, "*fall1.wav" ) );
cent->pe.painTime = cg.time; // don't play a pain sound right after this
@@ -649,7 +637,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_FALLING:
- DEBUGNAME( "EV_FALLING" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, CG_CustomSound( es->number, "*falling1.wav" ) );
break;
@@ -661,7 +648,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
case EV_STEPDN_8:
case EV_STEPDN_12:
case EV_STEPDN_16: // smooth out step down transitions
- DEBUGNAME( "EV_STEP" );
{
float oldStep;
int delta;
@@ -705,7 +691,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
}
case EV_JUMP:
- DEBUGNAME( "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 ) )
@@ -736,44 +721,36 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_LEV1_GRAB:
- DEBUGNAME( "EV_LEV1_GRAB" );
trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL1Grab );
break;
case EV_LEV4_TRAMPLE_PREPARE:
- DEBUGNAME( "EV_LEV4_TRAMPLE_PREPARE" );
trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL4ChargePrepare );
break;
case EV_LEV4_TRAMPLE_START:
- DEBUGNAME( "EV_LEV4_TRAMPLE_START" );
//FIXME: stop cgs.media.alienL4ChargePrepare playing here
trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.media.alienL4ChargeStart );
break;
case EV_TAUNT:
- DEBUGNAME( "EV_TAUNT" );
if( !cg_noTaunt.integer )
trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*taunt.wav" ) );
break;
case EV_WATER_TOUCH:
- DEBUGNAME( "EV_WATER_TOUCH" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.watrInSound );
break;
case EV_WATER_LEAVE:
- DEBUGNAME( "EV_WATER_LEAVE" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.watrOutSound );
break;
case EV_WATER_UNDER:
- DEBUGNAME( "EV_WATER_UNDER" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.watrUnSound );
break;
case EV_WATER_CLEAR:
- DEBUGNAME( "EV_WATER_CLEAR" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, CG_CustomSound( es->number, "*gasp.wav" ) );
break;
@@ -781,28 +758,23 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
// weapon events
//
case EV_NOAMMO:
- DEBUGNAME( "EV_NOAMMO" );
trap_S_StartSound( NULL, es->number, CHAN_WEAPON,
cgs.media.weaponEmptyClick );
break;
case EV_CHANGE_WEAPON:
- DEBUGNAME( "EV_CHANGE_WEAPON" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.selectSound );
break;
case EV_FIRE_WEAPON:
- DEBUGNAME( "EV_FIRE_WEAPON" );
CG_FireWeapon( cent, WPM_PRIMARY );
break;
case EV_FIRE_WEAPON2:
- DEBUGNAME( "EV_FIRE_WEAPON2" );
CG_FireWeapon( cent, WPM_SECONDARY );
break;
case EV_FIRE_WEAPON3:
- DEBUGNAME( "EV_FIRE_WEAPON3" );
CG_FireWeapon( cent, WPM_TERTIARY );
break;
@@ -812,32 +784,26 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
// other events
//
case EV_PLAYER_TELEPORT_IN:
- DEBUGNAME( "EV_PLAYER_TELEPORT_IN" );
//deprecated
break;
case EV_PLAYER_TELEPORT_OUT:
- DEBUGNAME( "EV_PLAYER_TELEPORT_OUT" );
CG_PlayerDisconnect( position );
break;
case EV_BUILD_CONSTRUCT:
- DEBUGNAME( "EV_BUILD_CONSTRUCT" );
//do something useful here
break;
case EV_BUILD_DESTROY:
- DEBUGNAME( "EV_BUILD_DESTROY" );
//do something useful here
break;
case EV_RPTUSE_SOUND:
- DEBUGNAME( "EV_RPTUSE_SOUND" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.repeaterUseSound );
break;
case EV_GRENADE_BOUNCE:
- DEBUGNAME( "EV_GRENADE_BOUNCE" );
if( rand( ) & 1 )
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.hardBounceSound1 );
else
@@ -848,37 +814,31 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
// missile impacts
//
case EV_MISSILE_HIT:
- DEBUGNAME( "EV_MISSILE_HIT" );
ByteToDir( es->eventParm, dir );
CG_MissileHitEntity( es->weapon, es->generic1, position, dir, es->otherEntityNum, es->torsoAnim );
break;
case EV_MISSILE_MISS:
- DEBUGNAME( "EV_MISSILE_MISS" );
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, es->generic1, 0, position, dir, IMPACTSOUND_DEFAULT, es->torsoAnim );
break;
case EV_MISSILE_MISS_METAL:
- DEBUGNAME( "EV_MISSILE_MISS_METAL" );
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, es->generic1, 0, position, dir, IMPACTSOUND_METAL, es->torsoAnim );
break;
case EV_HUMAN_BUILDABLE_EXPLOSION:
- DEBUGNAME( "EV_HUMAN_BUILDABLE_EXPLOSION" );
ByteToDir( es->eventParm, dir );
CG_HumanBuildableExplosion( position, dir );
break;
case EV_ALIEN_BUILDABLE_EXPLOSION:
- DEBUGNAME( "EV_ALIEN_BUILDABLE_EXPLOSION" );
ByteToDir( es->eventParm, dir );
CG_AlienBuildableExplosion( position, dir );
break;
case EV_TESLATRAIL:
- DEBUGNAME( "EV_TESLATRAIL" );
cent->currentState.weapon = WP_TESLAGEN;
{
centity_t *source = &cg_entities[ es->generic1 ];
@@ -904,23 +864,19 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_BULLET_HIT_WALL:
- DEBUGNAME( "EV_BULLET_HIT_WALL" );
ByteToDir( es->eventParm, dir );
CG_Bullet( es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD );
break;
case EV_BULLET_HIT_FLESH:
- DEBUGNAME( "EV_BULLET_HIT_FLESH" );
CG_Bullet( es->pos.trBase, es->otherEntityNum, dir, qtrue, es->eventParm );
break;
case EV_SHOTGUN:
- DEBUGNAME( "EV_SHOTGUN" );
CG_ShotgunFire( es );
break;
case EV_GENERAL_SOUND:
- DEBUGNAME( "EV_GENERAL_SOUND" );
if( cgs.gameSounds[ es->eventParm ] )
trap_S_StartSound( NULL, es->number, CHAN_VOICE, cgs.gameSounds[ es->eventParm ] );
else
@@ -931,7 +887,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_GLOBAL_SOUND: // play from the player's head so it never diminishes
- DEBUGNAME( "EV_GLOBAL_SOUND" );
if( cgs.gameSounds[ es->eventParm ] )
trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.gameSounds[ es->eventParm ] );
else
@@ -944,7 +899,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
case EV_PAIN:
// local player sounds are triggered in CG_CheckLocalSounds,
// so ignore events on the player
- DEBUGNAME( "EV_PAIN" );
if( cent->currentState.number != cg.snap->ps.clientNum )
CG_PainEvent( cent, es->eventParm );
break;
@@ -952,34 +906,28 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
case EV_DEATH1:
case EV_DEATH2:
case EV_DEATH3:
- DEBUGNAME( "EV_DEATHx" );
trap_S_StartSound( NULL, es->number, CHAN_VOICE,
CG_CustomSound( es->number, va( "*death%i.wav", event - EV_DEATH1 + 1 ) ) );
break;
case EV_OBITUARY:
- DEBUGNAME( "EV_OBITUARY" );
CG_Obituary( es );
break;
case EV_GIB_PLAYER:
- DEBUGNAME( "EV_GIB_PLAYER" );
// no gibbing
break;
case EV_STOPLOOPINGSOUND:
- DEBUGNAME( "EV_STOPLOOPINGSOUND" );
trap_S_StopLoopingSound( es->number );
es->loopSound = 0;
break;
case EV_DEBUG_LINE:
- DEBUGNAME( "EV_DEBUG_LINE" );
CG_Beam( cent );
break;
case EV_BUILD_DELAY:
- DEBUGNAME( "EV_BUILD_DELAY" );
if( clientNum == cg.predictedPlayerState.clientNum )
{
trap_S_StartLocalSound( cgs.media.buildableRepairedSound, CHAN_LOCAL_SOUND );
@@ -988,17 +936,14 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_BUILD_REPAIR:
- DEBUGNAME( "EV_BUILD_REPAIR" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.buildableRepairSound );
break;
case EV_BUILD_REPAIRED:
- DEBUGNAME( "EV_BUILD_REPAIRED" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.buildableRepairedSound );
break;
case EV_OVERMIND_ATTACK:
- DEBUGNAME( "EV_OVERMIND_ATTACK" );
if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS )
{
trap_S_StartLocalSound( cgs.media.alienOvermindAttack, CHAN_ANNOUNCER );
@@ -1007,7 +952,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_OVERMIND_DYING:
- DEBUGNAME( "EV_OVERMIND_DYING" );
if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS )
{
trap_S_StartLocalSound( cgs.media.alienOvermindDying, CHAN_ANNOUNCER );
@@ -1016,7 +960,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_DCC_ATTACK:
- DEBUGNAME( "EV_DCC_ATTACK" );
if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
//trap_S_StartLocalSound( cgs.media.humanDCCAttack, CHAN_ANNOUNCER );
@@ -1025,12 +968,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_MGTURRET_SPINUP:
- DEBUGNAME( "EV_MGTURRET_SPINUP" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.turretSpinupSound );
break;
case EV_OVERMIND_SPAWNS:
- DEBUGNAME( "EV_OVERMIND_SPAWNS" );
if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_ALIENS )
{
trap_S_StartLocalSound( cgs.media.alienOvermindSpawns, CHAN_ANNOUNCER );
@@ -1039,7 +980,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_ALIEN_EVOLVE:
- DEBUGNAME( "EV_ALIEN_EVOLVE" );
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.alienEvolveSound );
{
particleSystem_t *ps = CG_SpawnNewParticleSystem( cgs.media.alienEvolvePS );
@@ -1059,7 +999,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_ALIEN_EVOLVE_FAILED:
- DEBUGNAME( "EV_ALIEN_EVOLVE_FAILED" );
if( clientNum == cg.predictedPlayerState.clientNum )
{
//FIXME: change to "negative" sound
@@ -1069,7 +1008,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_ALIEN_ACIDTUBE:
- DEBUGNAME( "EV_ALIEN_ACIDTUBE" );
{
particleSystem_t *ps = CG_SpawnNewParticleSystem( cgs.media.alienAcidTubePS );
@@ -1084,23 +1022,19 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
break;
case EV_MEDKIT_USED:
- DEBUGNAME( "EV_MEDKIT_USED" );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.medkitUseSound );
break;
case EV_PLAYER_RESPAWN:
- DEBUGNAME( "EV_PLAYER_RESPAWN" );
if( es->number == cg.clientNum )
cg.spawnTime = cg.time;
break;
case EV_LEV2_ZAP:
- DEBUGNAME( "EV_LEV2_ZAP" );
CG_Level2Zap( es );
break;
default:
- DEBUGNAME( "UNKNOWN" );
CG_Error( "Unknown event: %i", event );
break;
}