]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Blaster now uses the real color of the player firing the shot
authorSamual Lenks <samual@xonotic.org>
Sat, 18 Aug 2012 23:42:56 +0000 (19:42 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 18 Aug 2012 23:42:56 +0000 (19:42 -0400)
qcsrc/client/miscfunctions.qc
qcsrc/client/particles.qc
qcsrc/server/w_laser.qc

index 72bb9c5c40a66ec0932bc1dbed0d3b2d00e8a292..29ae559418c319c207a7e994e05f4fb5505ce35b 100644 (file)
@@ -596,6 +596,20 @@ vector getplayerorigin(float pl)
        return GETPLAYERORIGIN_ERROR;
 }
 
+vector getcsqcplayercolor(float pl)
+{
+       entity e;
+       
+       e = CSQCModel_server2csqc(pl + 1);
+       if(e)
+       {
+               if(e.colormap > 0)
+                       return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE);
+       }
+       
+       return '1 1 1';
+}
+
 float getplayerisdead(float pl)
 {
        entity e;
index 0150bb28399bb186eb93c325e8dfb2c95de16e52..ac2f9fdea34dfeaf0308c630aee2e670db355f6e 100644 (file)
@@ -316,6 +316,8 @@ void Draw_Shockwave()
        
        vector deviation, angle;
 
+       vector sw_color = getcsqcplayercolor(self.sv_entnum - 1); // GetTeamRGB(GetPlayerColor(self.sv_entnum));
+
        vector first_min_end, prev_min_end, new_min_end;
        vector first_max_end, prev_max_end, new_max_end;
 
@@ -325,7 +327,7 @@ void Draw_Shockwave()
        vectorvectors(shotdir);
        vector right = v_right;
        vector up = v_up;
-
+       
        float counter, dist_before_normal = 200, shots = 20;
        
        vector min_end = ((self.sw_shotorg + (shotdir * dist_before_normal)) + (up * self.sw_spread_min));
@@ -366,16 +368,16 @@ void Draw_Shockwave()
                if(counter >= 1)
                {
                        R_BeginPolygon("", DRAWFLAG_NORMAL);
-                       R_PolygonVertex(prev_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(new_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(self.sw_shotorg, '0 0 0', '1 0 0', a);
+                       R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(self.sw_shotorg, '0 0 0', sw_color, a);
                        R_EndPolygon();
 
                        R_BeginPolygon("", DRAWFLAG_NORMAL);
-                       R_PolygonVertex(new_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(prev_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(prev_max_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(new_max_end, '0 0 0', '1 0 0', a);
+                       R_PolygonVertex(new_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(new_max_end, '0 0 0', sw_color, a);
                        R_EndPolygon();
                }
 
@@ -385,16 +387,16 @@ void Draw_Shockwave()
                if((counter + 1) == shots)
                {
                        R_BeginPolygon("", DRAWFLAG_NORMAL);
-                       R_PolygonVertex(prev_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(first_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(self.sw_shotorg, '0 0 0', '1 0 0', a);
+                       R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(self.sw_shotorg, '0 0 0', sw_color, a);
                        R_EndPolygon();
 
                        R_BeginPolygon("", DRAWFLAG_NORMAL);
-                       R_PolygonVertex(first_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(prev_min_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(prev_max_end, '0 0 0', '1 0 0', a);
-                       R_PolygonVertex(first_max_end, '0 0 0', '1 0 0', a);
+                       R_PolygonVertex(first_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a);
+                       R_PolygonVertex(first_max_end, '0 0 0', sw_color, a);
                        R_EndPolygon();
                }
        }
@@ -412,6 +414,8 @@ void Net_ReadShockwaveParticle()
        shockwave.sw_spread_max = ReadByte();
        shockwave.sw_spread_min = ReadByte();
 
+       shockwave.sv_entnum = ReadByte();
+
        shockwave.sw_time = time;
 }
 
index beaebf8a4be4d6c4c070fa7cce2020b8456bdbc7..25e240357e2a2e812ada00b18906045c29329464 100644 (file)
@@ -21,6 +21,7 @@ void SendCSQCShockwaveParticle(vector endpos)
        WriteCoord(MSG_BROADCAST, endpos_z);
        WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_shockwave_spread_max, 255));
        WriteByte(MSG_BROADCAST, bound(0, autocvar_g_balance_laser_shockwave_spread_min, 255));
+       WriteByte(MSG_BROADCAST, num_for_edict(self));
 }
 
 void W_Laser_Touch()