From e421272c3af862e6e8a7f984da8d9f6230583870 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Fri, 24 Mar 2017 15:41:54 +0000 Subject: [PATCH] Cvar to allow portals though player clips --- bal-wep-xonotic.cfg | 1 + qcsrc/common/weapons/weapon/porto.qc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 7d94daada..8d9037aab 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -431,6 +431,7 @@ set g_balance_porto_weaponreplace "" set g_balance_porto_weaponstart 0 set g_balance_porto_weaponstartoverride -1 set g_balance_porto_weaponthrowable 1 +set g_balance_porto_ignore_clips 0 "If non-zero, porto rockets can get through player clips" // }}} // {{{ #12: Vaporizer set g_balance_vaporizer_primary_ammo 10 diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index f7b7a100d..e898eefd3 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -29,6 +29,7 @@ CLASS(PortoLaunch, Weapon) P(class, prefix, weaponstartoverride, float, NONE) \ P(class, prefix, weaponstart, float, NONE) \ P(class, prefix, weaponthrowable, float, NONE) \ + P(class, prefix, ignore_clips, bool, NONE) \ END() W_PROPS(X, PortoLaunch, porto) #undef X @@ -289,7 +290,10 @@ void W_Porto_Attack(entity actor, .entity weaponentity, float type) fixedmakevectors(fixedvectoangles(gren.velocity)); gren.right_vector = v_right; - gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; + gren.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY; + + if(!WEP_CVAR(porto, ignore_clips)) + gren.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP; if(type > 0) CSQCProjectile(gren, true, PROJECTILE_PORTO_BLUE, true); -- 2.39.2