]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
Merge branch 'bones_was_here/sv_legacy_bbox_expand_4' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index d80703175983b87eb0c046ffa68e42276aad0d4e..280267a9ad3de6368294cb332cc34a829c261720 100644 (file)
@@ -10,6 +10,13 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own)
        {
                if(e.classname == "electro_orb")
                {
+                       // check if the ball we are exploding is not owned by an
+                       // independent player which is not the player who shot the ball
+                       if(IS_INDEPENDENT_PLAYER(e.realowner) && own != e.realowner)
+                       {
+                               e = e.chain;
+                               continue;
+                       }
                        // do we allow thruwall triggering?
                        if(WEP_CVAR(electro, combo_comboradius_thruwall))
                        {
@@ -49,7 +56,7 @@ void W_Electro_ExplodeCombo(entity this)
        W_Electro_TriggerCombo(this.origin, WEP_CVAR(electro, combo_comboradius), this.realowner);
 
        this.event_damage = func_null;
-       this.velocity = this.movedir; // particle fx and decals need .velocity
+       this.velocity = this.movedir; // .velocity must be != '0 0 0' for particle fx and decal to work
 
        RadiusDamage(
                this,
@@ -79,7 +86,7 @@ void W_Electro_Explode(entity this, entity directhitentity)
 
        this.event_damage = func_null;
        this.takedamage = DAMAGE_NO;
-       this.velocity = this.movedir; // particle fx and decals need .velocity
+       this.velocity = this.movedir; // .velocity must be != '0 0 0' for particle fx and decal to work
 
        if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway?
        {
@@ -151,6 +158,13 @@ void W_Electro_Bolt_Think(entity this)
                {
                        if(e.classname == "electro_orb")
                        {
+                               // check if the ball we are exploding is not owned by an
+                               // independent player which is not the player who shot the ball
+                               if(IS_INDEPENDENT_PLAYER(e.realowner) && this.realowner != e.realowner)
+                               {
+                                       e = e.chain;
+                                       continue;
+                               }
                                bool explode;
                                if (this.owner == e.owner)
                                {
@@ -291,6 +305,7 @@ void W_Electro_Orb_Stick(entity this, entity to)
 
        newproj.owner = this.owner;
        newproj.realowner = this.realowner;
+       PROJECTILE_MAKETRIGGER(newproj);
        setorigin(newproj, this.origin);
        setmodel(newproj, MDL_PROJECTILE_ELECTRO);
        setsize(newproj, this.mins, this.maxs);
@@ -495,9 +510,9 @@ METHOD(Electro, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)
         float shoot;
 
         if(WEP_CVAR_PRI(electro, speed))
-            shoot = bot_aim(actor, weaponentity, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
+            shoot = bot_aim(actor, weaponentity, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false, true);
         else
-            shoot = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false);
+            shoot = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false, true);
 
         if(shoot)
         {
@@ -507,7 +522,7 @@ METHOD(Electro, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)
     }
     else
     {
-        if(bot_aim(actor, weaponentity, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
+        if(bot_aim(actor, weaponentity, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true, true))
         {
             PHYS_INPUT_BUTTON_ATCK2(actor) = true;
             if(random() < 0.03) actor.bot_secondary_electromooth = 0;
@@ -604,8 +619,7 @@ METHOD(Electro, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);