]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_electro.qc
fix handling of kill triggers in freezetag, also electro needs to check for self...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_electro.qc
index 014fc34e51d15a4a176b793d7f34f35378ea24bc..a0b06c967c9e0ed3b3e1a09449be36ed25db4896 100644 (file)
@@ -178,8 +178,8 @@ void W_Electro_Attack2()
        proj.event_damage = W_Plasma_Damage;
        proj.flags = FL_PROJECTILE;
        
-       //proj.bouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
-       //proj.bouncestop = cvar("g_balance_electro_secondary_bouncestop");
+       proj.bouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
+       proj.bouncestop = cvar("g_balance_electro_secondary_bouncestop");
        
 #if 0
        entity p2;
@@ -231,7 +231,7 @@ void lgbeam_think()
                remove(self);
                return;
        }
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK)
+       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || (g_freezetag && self.owner.freezetag_frozen))
        {
                if(self == self.owner.lgbeam)
                        self.owner.lgbeam = world;
@@ -265,8 +265,9 @@ void lgbeam_think()
 
                f = ExponentialFalloff(cvar("g_balance_electro_primary_falloff_mindist"), cvar("g_balance_electro_primary_falloff_maxdist"), cvar("g_balance_electro_primary_falloff_halflifedist"), vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg));
 
+               if(accuracy_isgooddamage(self.owner, trace_ent))
+                       accuracy_add(self.owner, WEP_ELECTRO, 0, cvar("g_balance_electro_primary_damage") * dt * f);
                Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt * f, WEP_ELECTRO, trace_endpos, force * dt);
-               Damage_RecordDamage(self.owner, WEP_ELECTRO, cvar("g_balance_electro_primary_damage") * dt * f);
        }
        W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);