]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make it ACTUALLY use the proper spread
authorSamual <samual@xonotic.org>
Thu, 26 Jul 2012 06:58:07 +0000 (02:58 -0400)
committerSamual <samual@xonotic.org>
Thu, 26 Jul 2012 06:58:07 +0000 (02:58 -0400)
qcsrc/client/particles.qc
qcsrc/server/w_laser.qc

index 3c9961da7a133275e20d8e379b290c754573e1d2..7056f2ac5b9091bdfa82c83f6ffb3b4477ba058d 100644 (file)
@@ -334,9 +334,9 @@ void Net_ReadShockwaveParticle()
                if(lastdist)
                {
                        R_BeginPolygon("", DRAWFLAG_NORMAL);
-                       R_PolygonVertex(lastorg, '0 0 0', '1 0 0', 1);
-                       R_PolygonVertex(neworg, '0 0 0', '1 0 0', 1);
-                       R_PolygonVertex(shotorg, '0 0 0', '1 0 0', 1);
+                       R_PolygonVertex(lastorg, '0 0 0', '1 0 0', 0.5);
+                       R_PolygonVertex(neworg, '0 0 0', '1 0 0', 0.5);
+                       R_PolygonVertex(shotorg, '0 0 0', '1 0 0', 0.5);
                        R_EndPolygon();
                }
                
index f2ece0cad372222702c0ea06d6b330f2659c346f..fd98bf37927a9a63f024905463312516b9d749eb 100644 (file)
@@ -7,9 +7,9 @@ void() W_LastWeapon;
 .float swing_prev;
 .entity swing_alreadyhit;
 
-void SendCSQCShockwaveParticle(float spread, vector endpos, entity transform) 
+void SendCSQCShockwaveParticle(vector endpos, entity transform) 
 {
-       WarpZone_UnTransformOrigin(transform, endpos);
+       WarpZone_TransformOrigin(transform, endpos);
        WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
        WriteByte(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
        WriteCoord(MSG_BROADCAST, w_shotorg_x);
@@ -18,7 +18,9 @@ void SendCSQCShockwaveParticle(float spread, vector endpos, entity transform)
        WriteCoord(MSG_BROADCAST, endpos_x);
        WriteCoord(MSG_BROADCAST, endpos_y);
        WriteCoord(MSG_BROADCAST, endpos_z);
-       WriteByte(MSG_BROADCAST, bound(0, 255 * spread, 255));
+       
+       makevectors(w_shotdir);
+       WriteByte(MSG_BROADCAST, bound(0, 255 * vlen(normalize((endpos + (v_up * autocvar_g_balance_laser_primary_spread_max)) - w_shotorg) - w_shotdir), 255));
 }
 
 void W_Laser_Touch()
@@ -127,7 +129,7 @@ void W_Laser_Shockwave()
        RadiusDamageForSource(self, trace_endpos, '0 0 0', self, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_jumpradius, world, self, TRUE, autocvar_g_balance_laser_primary_force, WEP_LASER, world);
        
        // also do the firing effect now
-       SendCSQCShockwaveParticle(autocvar_g_balance_laser_primary_spread, attack_hitpos, transform);
+       SendCSQCShockwaveParticle(attack_endpos, transform);
        
        // did we hit a player directly?
        if(aim_ent.takedamage)