]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/pointparticles.qc
Cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / pointparticles.qc
index 9b32371dbeaa5af43a94e922bc179216d6f267c7..5e8636729c48a5e9183ef43314b071a2ba69d90c 100644 (file)
@@ -5,9 +5,9 @@
 #ifdef SVQC
 // NOTE: also contains func_sparks
 
-float pointparticles_SendEntity(entity to, float fl)
+bool pointparticles_SendEntity(entity this, entity to, float fl)
 {
-       WriteByte(MSG_ENTITY, ENT_CLIENT_POINTPARTICLES);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_POINTPARTICLES);
 
        // optional features to save space
        fl = fl & 0x0F;
@@ -89,13 +89,13 @@ float pointparticles_SendEntity(entity to, float fl)
 }
 
 void pointparticles_use()
-{
+{SELFPARAM();
        self.state = !self.state;
        self.SendFlags |= 2;
 }
 
 void pointparticles_think()
-{
+{SELFPARAM();
        if(self.origin != self.oldorigin)
        {
                self.SendFlags |= 4;
@@ -105,17 +105,17 @@ void pointparticles_think()
 }
 
 void pointparticles_reset()
-{
+{SELFPARAM();
        if(self.spawnflags & 1)
                self.state = 1;
        else
                self.state = 0;
 }
 
-void spawnfunc_func_pointparticles()
+spawnfunc(func_pointparticles)
 {
        if(self.model != "")
-               setmodel(self, self.model);
+               _setmodel(self, self.model);
        if(self.noise != "")
                precache_sound (self.noise);
 
@@ -141,7 +141,7 @@ void spawnfunc_func_pointparticles()
                setsize(self, '0 0 0', self.maxs - self.mins);
        }
        if(!self.cnt)
-               self.cnt = particleeffectnum(self.mdl);
+               self.cnt = _particleeffectnum(self.mdl);
 
        Net_LinkEntity(self, (self.spawnflags & 4), 0, pointparticles_SendEntity);
 
@@ -157,7 +157,7 @@ void spawnfunc_func_pointparticles()
        self.nextthink = time;
 }
 
-void spawnfunc_func_sparks()
+spawnfunc(func_sparks)
 {
        // self.cnt is the amount of sparks that one burst will spawn
        if(self.cnt < 1) {
@@ -179,11 +179,11 @@ void spawnfunc_func_sparks()
        self.wait = 0;
        self.cnt = 0; // use mdl
 
-       spawnfunc_func_pointparticles();
+       spawnfunc_func_pointparticles(this);
 }
 #elif defined(CSQC)
 
-void Draw_PointParticles()
+void Draw_PointParticles(entity this)
 {
        float n, i, fail;
        vector p;
@@ -221,16 +221,16 @@ void Draw_PointParticles()
                        {
                                traceline(p, p + normalize(self.movedir) * 4096, 0, world);
                                p = trace_endpos;
-                               pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count);
+                               __pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count);
                        }
                        else
                        {
-                               pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count);
+                               __pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count);
                        }
                        if(self.noise != "")
                        {
                                setorigin(self, p);
-                               sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten);
+                               _sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten);
                        }
                        self.just_toggled = 0;
                }
@@ -244,7 +244,7 @@ void Draw_PointParticles()
 }
 
 void Ent_PointParticles_Remove()
-{
+{SELFPARAM();
        if(self.noise)
                strunzone(self.noise);
        self.noise = string_null;
@@ -253,7 +253,7 @@ void Ent_PointParticles_Remove()
        self.bgmscript = string_null;
 }
 
-void Ent_PointParticles()
+NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew)
 {
        float i;
        vector v;
@@ -340,6 +340,8 @@ void Ent_PointParticles()
                BGMScript_InitEntity(self);
        }
 
+       return = true;
+
        if(f & 2)
        {
                self.absolute = (self.impulse >= 0);