fix electro combos through warpzones
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 28 Feb 2010 19:44:01 +0000 (19:44 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 28 Feb 2010 19:44:01 +0000 (19:44 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8707 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/w_electro.qc
data/qcsrc/warpzonelib/TODO

index c5355a1..867b61c 100644 (file)
@@ -9,22 +9,17 @@ void W_Plasma_Explode_Combo (void);
 void W_Plasma_TriggerCombo(vector org, float rad, entity own)
 {
        local entity e;
 void W_Plasma_TriggerCombo(vector org, float rad, entity own)
 {
        local entity e;
-       e = findradius(org, rad);
+       e = WarpZone_FindRadius(org, rad, TRUE);
        while (e)
        {
                if (e.classname == "plasma")
                {
        while (e)
        {
                if (e.classname == "plasma")
                {
-                       // see if there is line of sight to the combo ball
-                       traceline(org, e.origin, MOVE_NOMONSTERS, e);
-                       if (trace_fraction == 1 || trace_ent == e)
-                       {
-                               // change owner to whoever caused the combo explosion
-                               e.owner = own;
-                               e.takedamage = DAMAGE_NO;
-                               e.classname = "plasma_chain";
-                               e.think = W_Plasma_Explode_Combo;
-                               e.nextthink = time + vlen(e.origin - org) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
-                       }
+                       // change owner to whoever caused the combo explosion
+                       e.owner = own;
+                       e.takedamage = DAMAGE_NO;
+                       e.classname = "plasma_chain";
+                       e.think = W_Plasma_Explode_Combo;
+                       e.nextthink = time + vlen(e.WarpZone_findradius_dist) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
                }
                e = e.chain;
        }
                }
                e = e.chain;
        }
@@ -97,7 +92,8 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea
                        self.owner = inflictor.owner;
                        self.classname = "plasma_chain";
                        self.think = W_Plasma_Explode_Combo;
                        self.owner = inflictor.owner;
                        self.classname = "plasma_chain";
                        self.think = W_Plasma_Explode_Combo;
-                       self.nextthink = time + vlen(self.origin - inflictor.origin) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+                       self.nextthink = time + min(cvar("g_balance_electro_combo_radius"), vlen(self.origin - inflictor.origin)) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+                               //                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bounding the length, because inflictor may be in a galaxy far far away (warpzones)
                }
                else
                {
                }
                else
                {
index 7d1e386..faccb2b 100644 (file)
@@ -10,6 +10,7 @@ Weapon support:
 - shotgun: YES
 - uzi: YES
 - grenadelauncher: YES
 - shotgun: YES
 - uzi: YES
 - grenadelauncher: YES
+- electro: YES
 - crylink: YES
 - nex: YES
 - hagar: YES
 - crylink: YES
 - nex: YES
 - hagar: YES
@@ -18,7 +19,6 @@ Weapon support:
 - minstanex: YES
 - rifle: YES
 
 - minstanex: YES
 - rifle: YES
 
-- electro: PARTIAL (no combo detonation)
 - fireball: PARTIAL (no radius damage, laser damage)
 
 - rocketlauncher: NO (guiding not working, trail bug)
 - fireball: PARTIAL (no radius damage, laser damage)
 
 - rocketlauncher: NO (guiding not working, trail bug)