mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-11-10 06:31:47 +00:00
Fix hit accuracy stats for lightning gun and shotgun kills
If a lightning bolt killed a player or the first shotgun pellet that hit a player killed them, the shot was not counted as accurate. Check if shot player is alive for hit accuracy before dealing damage.
This commit is contained in:
parent
eeaade70bd
commit
51e9aa2df0
1 changed files with 10 additions and 22 deletions
|
@ -275,6 +275,7 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
||||||
vec3_t impactpoint, bouncedir;
|
vec3_t impactpoint, bouncedir;
|
||||||
#endif
|
#endif
|
||||||
vec3_t tr_start, tr_end;
|
vec3_t tr_start, tr_end;
|
||||||
|
qboolean hitClient = qfalse;
|
||||||
|
|
||||||
passent = ent->s.number;
|
passent = ent->s.number;
|
||||||
VectorCopy( start, tr_start );
|
VectorCopy( start, tr_start );
|
||||||
|
@ -304,19 +305,12 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
|
||||||
damage, 0, MOD_SHOTGUN);
|
|
||||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
|
||||||
return qtrue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
|
|
||||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
|
||||||
return qtrue;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||||
|
hitClient = qtrue;
|
||||||
|
}
|
||||||
|
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
|
||||||
|
return hitClient;
|
||||||
}
|
}
|
||||||
return qfalse;
|
return qfalse;
|
||||||
}
|
}
|
||||||
|
@ -663,14 +657,11 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
|
||||||
damage, 0, MOD_LIGHTNING);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
|
||||||
damage, 0, MOD_LIGHTNING);
|
|
||||||
#endif
|
#endif
|
||||||
|
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||||
|
ent->client->accuracy_hits++;
|
||||||
|
}
|
||||||
|
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_LIGHTNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( traceEnt->takedamage && traceEnt->client ) {
|
if ( traceEnt->takedamage && traceEnt->client ) {
|
||||||
|
@ -678,9 +669,6 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
||||||
tent->s.otherEntityNum = traceEnt->s.number;
|
tent->s.otherEntityNum = traceEnt->s.number;
|
||||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
tent->s.eventParm = DirToByte( tr.plane.normal );
|
||||||
tent->s.weapon = ent->s.weapon;
|
tent->s.weapon = ent->s.weapon;
|
||||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
|
||||||
ent->client->accuracy_hits++;
|
|
||||||
}
|
|
||||||
} else if ( !( tr.surfaceFlags & SURF_NOIMPACT ) ) {
|
} else if ( !( tr.surfaceFlags & SURF_NOIMPACT ) ) {
|
||||||
tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS );
|
tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS );
|
||||||
tent->s.eventParm = DirToByte( tr.plane.normal );
|
tent->s.eventParm = DirToByte( tr.plane.normal );
|
||||||
|
|
Loading…
Reference in a new issue