Merge remote branch 'origin/fruitiex/fruitbalance' into divVerent/fruitbalance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_electro.qc
index ef478e2..fed5204 100644 (file)
@@ -215,6 +215,8 @@ float lgbeam_send(entity to, float sf)
 void lgbeam_think()
 {
        vector endpos;
+       float oldsolid;
+
        self.owner.prevlgfire = time;
        if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self != self.owner.lgbeam || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK)
        {
@@ -237,9 +239,14 @@ void lgbeam_think()
                vecs = debug_shotorg;
        org = self.owner.origin + self.owner.view_ofs + v_forward * vecs_x + v_right * -vecs_y + v_up * vecs_z;
 
-       WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_electro_primary_range"), FALSE, self.owner, ANTILAG_LATENCY(self.owner));
+       oldsolid = self.owner.dphitcontentsmask;
+       self.owner.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+
+       WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_electro_primary_range"), MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
        endpos = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-       WarpZone_traceline_antilag(self.owner, org, endpos, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
+       WarpZone_traceline_antilag(self.owner, org, endpos + 4 * normalize(endpos - org), MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
+
+       self.owner.dphitcontentsmask = oldsolid;
 
        if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
                self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);