Removed more unlagged stuff that was messing up impact marks and fixed a

booboo in the UI ssg xhair previews.
This commit is contained in:
Richard Allen 2003-04-07 02:18:49 +00:00
parent a4c559dcd8
commit 3202076f82
2 changed files with 67 additions and 90 deletions

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.72 2003/04/07 02:18:49 jbravo
// Removed more unlagged stuff that was messing up impact marks and fixed a
// booboo in the UI ssg xhair previews.
//
// Revision 1.71 2003/03/09 21:30:38 jbravo // Revision 1.71 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -1006,122 +1010,85 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
case EV_BULLET_HIT_WALL: case EV_BULLET_HIT_WALL:
DEBUGNAME("EV_BULLET_HIT_WALL"); DEBUGNAME("EV_BULLET_HIT_WALL");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_DEFAULT);
// do nothing, because it was already predicted
// Com_Printf("Ignoring bullet event\n");
} else {
// do the bullet, because it wasn't predicted
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_DEFAULT);
//Com_Printf("Non-predicted bullet\n");
}
break; break;
case EV_BULLET_HIT_METAL: case EV_BULLET_HIT_METAL:
DEBUGNAME("EV_BULLET_HIT_METAL"); DEBUGNAME("EV_BULLET_HIT_METAL");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_METAL);
} else {
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_METAL);
}
break; break;
case EV_BULLET_HIT_GLASS: case EV_BULLET_HIT_GLASS:
DEBUGNAME("EV_BULLET_HIT_GLASS"); DEBUGNAME("EV_BULLET_HIT_GLASS");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_GLASS);
} else {
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_GLASS);
}
break; break;
//Makro - added //Makro - added
case EV_BULLET_HIT_WOOD: case EV_BULLET_HIT_WOOD:
DEBUGNAME("EV_BULLET_HIT_WOOD"); DEBUGNAME("EV_BULLET_HIT_WOOD");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_WOOD);
} else {
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_WOOD);
}
break; break;
//Makro - added //Makro - added
case EV_BULLET_HIT_BRICK: case EV_BULLET_HIT_BRICK:
DEBUGNAME("EV_BULLET_HIT_BRICK"); DEBUGNAME("EV_BULLET_HIT_BRICK");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_BRICK);
} else {
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_BRICK);
}
break; break;
//Makro - added //Makro - added
case EV_BULLET_HIT_CERAMIC: case EV_BULLET_HIT_CERAMIC:
DEBUGNAME("EV_BULLET_HIT_CERAMIC"); DEBUGNAME("EV_BULLET_HIT_CERAMIC");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_CERAMIC);
} else {
ByteToDir(es->eventParm, dir);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qfalse, ENTITYNUM_WORLD, IMPACTSOUND_CERAMIC);
}
break; break;
case EV_BULLET_HIT_KEVLAR: case EV_BULLET_HIT_KEVLAR:
DEBUGNAME("EV_BULLET_HIT_KEVLAR"); DEBUGNAME("EV_BULLET_HIT_KEVLAR");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { VectorScale(dir, -1, dir);
} else { trap_S_StartSound(NULL, es->number, CHAN_AUTO, cgs.media.kevlarHitSound);
ByteToDir(es->eventParm, dir); if (cg_RQ3_impactEffects.integer) {
VectorScale(dir, -1, dir); vec3_t velocity;
trap_S_StartSound(NULL, es->number, CHAN_AUTO, cgs.media.kevlarHitSound); vec3_t origin;
if (cg_RQ3_impactEffects.integer) { int sparkCount;
vec3_t velocity, origin; int i;
int sparkCount, i;
sparkCount = 20 + rand() % 15; sparkCount = 20 + rand() % 15;
VectorCopy(es->pos.trBase, origin); VectorCopy(es->pos.trBase, origin);
origin[2] += 12; origin[2] += 12;
// Generate the particles // Generate the particles
for (i = 0; i < sparkCount; i++) { for (i = 0; i < sparkCount; i++) {
VectorScale(dir, 150 + rand() % 30, velocity); VectorScale(dir, 150 + rand() % 30, velocity);
//random upwards sparks //random upwards sparks
if (rand() % 5 < 1) if (rand() % 5 < 1)
velocity[2] += 120 + rand() % 30; velocity[2] += 120 + rand() % 30;
velocity[0] += rand() % 80 - 40; velocity[0] += rand() % 80 - 40;
velocity[1] += rand() % 80 - 40; velocity[1] += rand() % 80 - 40;
CG_ParticleSparks(origin, velocity, 150 + rand() % 120, 2, 2, -4, 1); CG_ParticleSparks(origin, velocity, 150 + rand() % 120, 2, 2, -4, 1);
}
} }
} }
break; break;
case EV_BULLET_HIT_FLESH: case EV_BULLET_HIT_FLESH:
DEBUGNAME("EV_BULLET_HIT_FLESH"); DEBUGNAME("EV_BULLET_HIT_FLESH");
if (es->clientNum == cg.predictedPlayerState.clientNum && //ByteToDir( es->eventParm, dir );
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { //Elder: added additional param
} else { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qtrue, es->otherEntityNum2, IMPACTSOUND_FLESH);
//ByteToDir( es->eventParm, dir );
//Elder: added additional param
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qtrue, es->otherEntityNum2, IMPACTSOUND_FLESH);
}
break; break;
case EV_SSG3000_HIT_FLESH: case EV_SSG3000_HIT_FLESH:
DEBUGNAME("EV_SSG3000_HIT_FLESH"); DEBUGNAME("EV_SSG3000_HIT_FLESH");
if (es->clientNum == cg.predictedPlayerState.clientNum && ByteToDir(es->eventParm, dir);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 2)) { //Elder: added additional param
} else { CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qtrue, es->otherEntityNum2, IMPACTSOUND_FLESH);
ByteToDir(es->eventParm, dir); VectorAdd(es->pos.trBase, dir, dir);
//Elder: added additional param CG_BleedSpray(es->pos.trBase, dir, es->otherEntityNum2, 10);
CG_Bullet(es->pos.trBase, es->otherEntityNum, dir, qtrue, es->otherEntityNum2, IMPACTSOUND_FLESH);
VectorAdd(es->pos.trBase, dir, dir);
CG_BleedSpray(es->pos.trBase, dir, es->otherEntityNum2, 10);
}
break; break;
case EV_JUMPKICK: case EV_JUMPKICK:
@ -1145,20 +1112,12 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
case EV_SHOTGUN: case EV_SHOTGUN:
DEBUGNAME("EV_SHOTGUN"); DEBUGNAME("EV_SHOTGUN");
if (es->otherEntityNum == cg.predictedPlayerState.clientNum && CG_ShotgunFire(es, qtrue);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 4)) {
} else {
CG_ShotgunFire(es, qtrue);
}
break; break;
case EV_HANDCANNON: case EV_HANDCANNON:
DEBUGNAME("EV_HANDCANNON"); DEBUGNAME("EV_SHOTGUN");
if (es->otherEntityNum == cg.predictedPlayerState.clientNum && CG_ShotgunFire(es, qfalse);
cgs.delagHitscan && (cg_delag.integer & 1 || cg_delag.integer & 4)) {
} else {
CG_ShotgunFire(es, qfalse);
}
break; break;
case EV_GENERAL_SOUND: case EV_GENERAL_SOUND:
@ -1189,6 +1148,16 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
case RQ3_SOUND_KICK: case RQ3_SOUND_KICK:
trap_S_StartSound(NULL, es->number, CHAN_AUTO, cgs.media.kickSound); trap_S_StartSound(NULL, es->number, CHAN_AUTO, cgs.media.kickSound);
break; break;
//Elder: handled in EV_HEADSHOT now
/*
case RQ3_SOUND_HEADSHOT:
//CG_Printf("EV_RQ3_SOUND: Headshot\n");
//Elder: extra blood - synched with sound
//CG_Bleed( position, es->number );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.headshotSound);
break;
*/
case RQ3_SOUND_LCA: case RQ3_SOUND_LCA:
//Global sound //Global sound
//trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.media.lcaSound); //trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.media.lcaSound);

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.72 2003/04/07 02:18:49 jbravo
// Removed more unlagged stuff that was messing up impact marks and fixed a
// booboo in the UI ssg xhair previews.
//
// Revision 1.71 2003/04/06 18:31:21 makro // Revision 1.71 2003/04/06 18:31:21 makro
// SSG crosshairs // SSG crosshairs
// //
@ -4989,10 +4993,14 @@ static void UI_RunMenuScript(char **args)
else if (current >= NUM_SSGCROSSHAIRS) else if (current >= NUM_SSGCROSSHAIRS)
current = 0; current = 0;
if (instant) { if (instant) {
if (current == 0) /* if (current == 0)
uiInfo.uiDC.Assets.SSGcrosshairShader = uiInfo.uiDC.Assets.SSGcrosshairShader =
trap_R_RegisterShaderNoMip("gfx/rq3_hud/ssg2x"); trap_R_RegisterShaderNoMip("gfx/rq3_hud/ssg2x");
else else
uiInfo.uiDC.Assets.SSGcrosshairShader =
trap_R_RegisterShaderNoMip(va
("gfx/rq3_hud/ssg2x-%i",
current)); */
uiInfo.uiDC.Assets.SSGcrosshairShader = uiInfo.uiDC.Assets.SSGcrosshairShader =
trap_R_RegisterShaderNoMip(va trap_R_RegisterShaderNoMip(va
("gfx/rq3_hud/ssg2x-%i", ("gfx/rq3_hud/ssg2x-%i",