From: Mario Date: Mon, 26 Feb 2018 05:20:45 +0000 (+1000) Subject: Remove the null weapon check from W_SetupShot and make sure accuracy_add doesn't... X-Git-Tag: xonotic-v0.8.5~2279 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e82f2d89ee016e113dbbbff86df36f2bea57899;p=xonotic%2Fxonotic-data.pk3dir.git Remove the null weapon check from W_SetupShot and make sure accuracy_add doesn't try to add accuracy to the null weapon --- 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))