From 6e82f2d89ee016e113dbbbff86df36f2bea57899 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 26 Feb 2018 15:20:45 +1000 Subject: [PATCH] Remove the null weapon check from W_SetupShot and make sure accuracy_add doesn't try to add accuracy to the null weapon --- qcsrc/server/weapons/accuracy.qc | 1 + qcsrc/server/weapons/tracing.qc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index c0441ca16..1eda4e25b 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -67,6 +67,7 @@ void accuracy_add(entity this, int w, int fired, int hit) entity a = CS(this).accuracy; if (!a) return; if (!hit && !fired) return; + if (w == WEP_Null.m_id) return; w -= WEP_FIRST; int b = accuracy_byte(a.accuracy_hit[w], a.accuracy_fired[w]); if (hit) a.accuracy_hit [w] += hit; diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 8501e5186..a3898c627 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -30,8 +30,6 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us? float oldsolid = ent.dphitcontentsmask; Weapon wep = DEATH_WEAPONOF(deathtype); - if (wep == WEP_Null) - wep = ent.(weaponentity).m_weapon; // TODO: don't fall back, if the attack isn't a weapon we don't want it to affect the user's held weapon! if(!IS_CLIENT(ent)) antilag = false; // no antilag for non-clients! if (IS_PLAYER(ent) && (wep.spawnflags & WEP_FLAG_PENETRATEWALLS)) -- 2.39.2