]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weaponsystem.qc
Revert "weapon_railgun should spawn a nex, not a sniper rifle!", as this makes too...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index 4f5e7604448fc0e7458a91be39f81fc4808f9f20..057c5cb1dc767fde25d85b66a61ca8ee519cbf32 100644 (file)
@@ -138,7 +138,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        local float oldsolid;
        vector vecs, dv;
        oldsolid = ent.dphitcontentsmask;
-       if(ent.weapon == WEP_CAMPINGRIFLE)
+       if(ent.weapon == WEP_SNIPERRIFLE)
                ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
        else
                ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
@@ -158,6 +158,10 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        v_right = vr;
        v_up = vu;
 
+       // un-adjust trueaim if shotend is too close
+       if(vlen(w_shotend - (ent.origin + ent.view_ofs)) < autocvar_g_trueaim_minrange)
+               w_shotend = ent.origin + ent.view_ofs + s_forward * autocvar_g_trueaim_minrange;
+
        // track max damage
        if(accuracy_canbegooddamage(ent))
                accuracy_add(ent, ent.weapon, maxdamage, 0);