mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-13 08:27:42 +00:00
tracerchance now can be 0.0 to 0.4
This commit is contained in:
parent
4eb9d3f0a1
commit
5f70890928
2 changed files with 20 additions and 9 deletions
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.111 2002/09/08 03:15:16 niceass
|
||||||
|
// tracerchance now can be 0.0 to 0.4
|
||||||
|
//
|
||||||
// Revision 1.110 2002/08/29 14:25:13 niceass
|
// Revision 1.110 2002/08/29 14:25:13 niceass
|
||||||
// new wallhack thing
|
// new wallhack thing
|
||||||
//
|
//
|
||||||
|
@ -588,7 +591,7 @@ static cvarTable_t cvarTable[] = { // bk001129
|
||||||
{&cg_nopredict, "cg_nopredict", "0", 0},
|
{&cg_nopredict, "cg_nopredict", "0", 0},
|
||||||
{&cg_noPlayerAnims, "cg_noplayeranims", "0", CVAR_CHEAT},
|
{&cg_noPlayerAnims, "cg_noplayeranims", "0", CVAR_CHEAT},
|
||||||
{&cg_showmiss, "cg_showmiss", "0", 0},
|
{&cg_showmiss, "cg_showmiss", "0", 0},
|
||||||
{&cg_footsteps, "cg_footsteps", "1", CVAR_CHEAT},
|
{&cg_footsteps, "cg_footsteps", "1", CVAR_ARCHIVE},
|
||||||
{&cg_tracerChance, "cg_tracerchance", "0.4", CVAR_CHEAT},
|
{&cg_tracerChance, "cg_tracerchance", "0.4", CVAR_CHEAT},
|
||||||
{&cg_tracerWidth, "cg_tracerwidth", "1", CVAR_CHEAT},
|
{&cg_tracerWidth, "cg_tracerwidth", "1", CVAR_CHEAT},
|
||||||
{&cg_tracerLength, "cg_tracerlength", "300", CVAR_CHEAT},
|
{&cg_tracerLength, "cg_tracerlength", "300", CVAR_CHEAT},
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.94 2002/09/08 03:14:17 niceass
|
||||||
|
// tracerchance now can be 0.0 to 0.4
|
||||||
|
//
|
||||||
// Revision 1.93 2002/08/29 04:42:41 blaze
|
// Revision 1.93 2002/08/29 04:42:41 blaze
|
||||||
// Anti OGC code
|
// Anti OGC code
|
||||||
//
|
//
|
||||||
|
@ -3705,7 +3708,7 @@ void CG_CreateTracer(int entity, vec3_t start, vec3_t end)
|
||||||
float dist;
|
float dist;
|
||||||
vec3_t dir, end2;
|
vec3_t dir, end2;
|
||||||
vec3_t temp, midpoint;
|
vec3_t temp, midpoint;
|
||||||
float tracerSpeed = 4200;
|
float tracerSpeed = 5000;
|
||||||
|
|
||||||
VectorSubtract(end, start, dir);
|
VectorSubtract(end, start, dir);
|
||||||
dist = VectorNormalize(dir);
|
dist = VectorNormalize(dir);
|
||||||
|
@ -3827,14 +3830,19 @@ Elder: added soundType conditional
|
||||||
void CG_Bullet(vec3_t end, int sourceEntityNum, vec3_t normal,
|
void CG_Bullet(vec3_t end, int sourceEntityNum, vec3_t normal,
|
||||||
qboolean flesh, int fleshEntityNum, impactSound_t soundType)
|
qboolean flesh, int fleshEntityNum, impactSound_t soundType)
|
||||||
{
|
{
|
||||||
trace_t trace;
|
trace_t trace;
|
||||||
int sourceContentType, destContentType;
|
int sourceContentType, destContentType;
|
||||||
vec3_t start;
|
vec3_t start;
|
||||||
centity_t *cent;
|
centity_t *cent;
|
||||||
|
float chance;
|
||||||
|
|
||||||
|
chance = cg_tracerChance.value;
|
||||||
|
if (chance > 0.4f)
|
||||||
|
chance = 0.4f;
|
||||||
|
|
||||||
// if the shooter is currently valid, calc a source point and possibly
|
// if the shooter is currently valid, calc a source point and possibly
|
||||||
// do trail effects
|
// do trail effects
|
||||||
if (sourceEntityNum >= 0 && cg_tracerChance.value > 0) {
|
if (sourceEntityNum >= 0 && chance > 0) {
|
||||||
if (CG_CalcMuzzlePoint(sourceEntityNum, start)) {
|
if (CG_CalcMuzzlePoint(sourceEntityNum, start)) {
|
||||||
sourceContentType = trap_CM_PointContents(start, 0);
|
sourceContentType = trap_CM_PointContents(start, 0);
|
||||||
destContentType = trap_CM_PointContents(end, 0);
|
destContentType = trap_CM_PointContents(end, 0);
|
||||||
|
@ -3859,13 +3867,13 @@ void CG_Bullet(vec3_t end, int sourceEntityNum, vec3_t normal,
|
||||||
if (sourceEntityNum == cg.snap->ps.clientNum) {
|
if (sourceEntityNum == cg.snap->ps.clientNum) {
|
||||||
if (cg.snap->ps.weapon != WP_SSG3000 &&
|
if (cg.snap->ps.weapon != WP_SSG3000 &&
|
||||||
bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag != HI_SILENCER) {
|
bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag != HI_SILENCER) {
|
||||||
if (random() < cg_tracerChance.value)
|
if (random() < chance)
|
||||||
CG_CreateTracer(sourceEntityNum, start, end);
|
CG_CreateTracer(sourceEntityNum, start, end);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cent = &cg_entities[sourceEntityNum];
|
cent = &cg_entities[sourceEntityNum];
|
||||||
if (cent->currentValid && cent->currentState.weapon != WP_SSG3000) {
|
if (cent->currentValid && cent->currentState.weapon != WP_SSG3000) {
|
||||||
if (random() < cg_tracerChance.value && cent->muzzleFlashTime != -1) {
|
if (random() < chance && cent->muzzleFlashTime != -1) {
|
||||||
CG_CreateTracer(sourceEntityNum, start, end);
|
CG_CreateTracer(sourceEntityNum, start, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue