Merge remote branch 'origin/fruitiex/fruitbalance' into divVerent/fruitbalance
authorRudolf Polzer <divverent@alientrap.org>
Fri, 23 Jul 2010 05:53:02 +0000 (07:53 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 23 Jul 2010 05:53:02 +0000 (07:53 +0200)
qcsrc/client/projectile.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_laser.qc
qcsrc/warpzonelib/common.qc

index e1f325a..6c27a52 100644 (file)
@@ -317,8 +317,8 @@ void Ent_Projectile()
                        case PROJECTILE_ELECTRO:
                                // only new engines support sound moving with object
                                loopsound(self, CHAN_PROJECTILE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
-                               self.mins = '0 0 -3';
-                               self.maxs = '0 0 -3';
+                               self.mins = '0 0 -4';
+                               self.maxs = '0 0 -4';
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = SUB_Null;
                                break;
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);
index 49e2cc4..c3840ac 100644 (file)
@@ -132,6 +132,8 @@ float gauntletbeam_send(entity to, float sf)
 void gauntletbeam_think()
 {
        vector endpos;
+       float oldsolid;
+
        float damage, myforce, myradius;
        if(self.cnt)
        {
@@ -168,9 +170,14 @@ void gauntletbeam_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 * myradius, 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 * myradius, 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;
 
        // apply the damage
        if(trace_fraction < 1)
index af53081..1c3835a 100644 (file)
@@ -1,3 +1,6 @@
+float trace_dphitcontents;
+.float dphitcontents;
+
 void WarpZone_Accumulator_Clear(entity acc)
 {
        acc.warpzone_transform = '0 0 0';
@@ -167,6 +170,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
 {
        float nomonsters_adjusted;
        float frac, sol, i;
+       float contentshack;
        vector o0, e0;
        entity wz;
        vector vf, vr, vu;
@@ -186,6 +190,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        nomonsters_adjusted = nomonsters;
                        break;
        }
+       if((contentshack = (forent.dphitcontentsmask && !(forent.dphitcontentsmask & DPCONTENTS_SOLID))))
+               forent.dphitcontentsmask |= DPCONTENTS_SOLID;
 
        WarpZone_Trace_InitTransform();
        // if starting in warpzone, first transform
@@ -227,7 +233,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                        break;
                if(trace_ent.classname != "trigger_warpzone")
                {
-                       if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent))
+                       if((nomonsters == MOVE_NOTHING) || ((nomonsters == MOVE_WORLDONLY) && trace_ent) || (contentshack && (trace_dphitcontents & forent.dphitcontentsmask) == DPCONTENTS_SOLID))
                        {
                                // continue the trace, ignoring this hit (we only care for warpzones)
                                org = trace_endpos + normalize(end - org);
@@ -253,6 +259,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
        }
        WarpZone_MakeAllOther();
 :fail
+       if(contentshack)
+               forent.dphitcontentsmask &~= DPCONTENTS_SOLID;
        trace_startsolid = sol;
        v_forward = vf;
        v_right = vr;