From 1617a82857a149add8665e9a8a3e216f91304d2c Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sat, 14 Sep 2013 00:26:10 -0400 Subject: [PATCH] Allow a smaller Electro comboradius for triggering through walls (plays better) --- qcsrc/common/weapons/w_electro.qc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index 55843fcae..548058baf 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -14,6 +14,7 @@ REGISTER_WEAPON( #ifdef SVQC void ElectroInit(); vector electro_shotorigin[4]; +var float autocvar_g_balance_electro_combo_comboradius_thruwall = 200; #endif #else #ifdef SVQC @@ -27,17 +28,22 @@ void W_Plasma_Explode_Combo (void); void W_Plasma_TriggerCombo(vector org, float rad, entity own) { entity e; - e = WarpZone_FindRadius(org, rad, TRUE); + e = WarpZone_FindRadius(org, rad, !autocvar_g_balance_electro_combo_comboradius_thruwall); while (e) { if (e.classname == "plasma") { // change owner to whoever caused the combo explosion - e.realowner = own; - e.takedamage = DAMAGE_NO; - e.classname = "plasma_chain"; - e.think = W_Plasma_Explode_Combo; - e.nextthink = time + vlen(e.WarpZone_findradius_dist) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler + WarpZone_TraceLine(org, e.origin, MOVE_NOMONSTERS, e); + + if((trace_fraction == 1) || (autocvar_g_balance_electro_combo_comboradius_thruwall > e.WarpZone_findradius_dist)) + { + e.realowner = own; + e.takedamage = DAMAGE_NO; + e.classname = "plasma_chain"; + e.think = W_Plasma_Explode_Combo; + e.nextthink = time + vlen(e.WarpZone_findradius_dist) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler + } } e = e.chain; } -- 2.39.2