]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/rainsnow.qc
Merge branch 'terencehill/cl_forceplayercolors_2' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / rainsnow.qc
index deb5ee58bfd94e3598ffad20c21444111e6dfe7b..7ed9c558c33b55d2914c3bca4ca638ec1f9370d3 100644 (file)
@@ -1,7 +1,9 @@
+REGISTER_NET_LINKED(ENT_CLIENT_RAINSNOW)
+
 #ifdef SVQC
-float rainsnow_SendEntity(entity to, float sf)
+bool rainsnow_SendEntity(entity this, entity to, float sf)
 {
-       WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
        WriteByte(MSG_ENTITY, self.state);
        WriteCoord(MSG_ENTITY, self.origin_x + self.mins_x);
        WriteCoord(MSG_ENTITY, self.origin_y + self.mins_y);
@@ -12,7 +14,7 @@ float rainsnow_SendEntity(entity to, float sf)
        WriteShort(MSG_ENTITY, compressShortVector(self.dest));
        WriteShort(MSG_ENTITY, self.count);
        WriteByte(MSG_ENTITY, self.cnt);
-       return 1;
+       return true;
 }
 
 /*QUAKED spawnfunc_func_rain (0 .5 .8) ?
@@ -26,7 +28,7 @@ Keys:
 "count"
  adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
 */
-void spawnfunc_func_rain()
+spawnfunc(func_rain)
 {
        self.dest = self.velocity;
        self.velocity = '0 0 0';
@@ -64,7 +66,7 @@ Keys:
 "count"
  adjusts density, this many particles fall every second for a 1024x1024 area, default is 2000
 */
-void spawnfunc_func_snow()
+spawnfunc(func_snow)
 {
        self.dest = self.velocity;
        self.velocity = '0 0 0';
@@ -90,17 +92,17 @@ void spawnfunc_func_snow()
        Net_LinkEntity(self, false, 0, rainsnow_SendEntity);
 }
 #elif defined(CSQC)
-void Draw_Rain()
+void Draw_Rain(entity this)
 {
     te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
 }
 
-void Draw_Snow()
+void Draw_Snow(entity this)
 {
     te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color);
 }
 
-void Ent_RainOrSnow()
+NET_HANDLE(ENT_CLIENT_RAINSNOW, bool isnew)
 {
        self.impulse = ReadByte(); // Rain, Snow, or Whatever
        self.origin_x = ReadCoord();
@@ -113,6 +115,8 @@ void Ent_RainOrSnow()
        self.count = ReadShort() * 10;
        self.glow_color = ReadByte(); // color
 
+       return = true;
+
        self.mins    = -0.5 * self.maxs;
        self.maxs    =  0.5 * self.maxs;
        self.origin  = self.origin - self.mins;