]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow a smaller Electro comboradius for triggering through walls (plays better)
authorSamual Lenks <samual@xonotic.org>
Sat, 14 Sep 2013 04:26:10 +0000 (00:26 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 14 Sep 2013 04:26:10 +0000 (00:26 -0400)
qcsrc/common/weapons/w_electro.qc

index 55843fcae5df76c8117232c0cdecbb8d1e9e9939..548058baf58514f507b732522d5927333d76e055 100644 (file)
@@ -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;
        }