]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/pointparticles.qc
Merge branch 'master' into DefaultUser/trigger_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / pointparticles.qc
index 18d3c30e8d774478102c28344bd894bc4681cb6c..7de5a03ef8171e905ea0d7eff538580ad7e22f5e 100644 (file)
@@ -149,17 +149,17 @@ spawnfunc(func_sparks)
 .int dphitcontentsmask;
 
 entityclass(PointParticles);
-class(PointParticles) .int cnt; // effect number
-class(PointParticles) .vector velocity; // particle velocity
-class(PointParticles) .float waterlevel; // direction jitter
-class(PointParticles) .int count; // count multiplier
-class(PointParticles) .int impulse; // density
-class(PointParticles) .string noise; // sound
-class(PointParticles) .float atten;
-class(PointParticles) .float volume;
-class(PointParticles) .int absolute; // 1 = count per second is absolute, ABSOLUTE_ONLY_SPAWN_AT_TOGGLE = only spawn at toggle
-class(PointParticles) .vector movedir; // trace direction
-class(PointParticles) .float glow_color; // palette index
+classfield(PointParticles) .int cnt; // effect number
+classfield(PointParticles) .vector velocity; // particle velocity
+classfield(PointParticles) .float waterlevel; // direction jitter
+classfield(PointParticles) .int count; // count multiplier
+classfield(PointParticles) .int impulse; // density
+classfield(PointParticles) .string noise; // sound
+classfield(PointParticles) .float atten;
+classfield(PointParticles) .float volume;
+classfield(PointParticles) .float absolute; // 1 = count per second is absolute, ABSOLUTE_ONLY_SPAWN_AT_TOGGLE = only spawn at toggle
+classfield(PointParticles) .vector movedir; // trace direction
+classfield(PointParticles) .float glow_color; // palette index
 
 const int ABSOLUTE_ONLY_SPAWN_AT_TOGGLE = 2;
 
@@ -235,15 +235,9 @@ void Draw_PointParticles(entity this)
 
 void Ent_PointParticles_Remove(entity this)
 {
-       if(this.noise)
-               strunzone(this.noise);
-       this.noise = string_null;
-       if(this.bgmscript)
-               strunzone(this.bgmscript);
-       this.bgmscript = string_null;
-       if(this.mdl)
-               strunzone(this.mdl);
-       this.mdl = string_null;
+    strfree(this.noise);
+    strfree(this.bgmscript);
+    strfree(this.mdl);
 }
 
 NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew)
@@ -305,17 +299,13 @@ NET_HANDLE(ENT_CLIENT_POINTPARTICLES, bool isnew)
                        this.waterlevel = 0;
                        this.count = 1;
                }
-               if(this.noise)
-                       strunzone(this.noise);
-               if(this.bgmscript)
-                       strunzone(this.bgmscript);
-               this.noise = strzone(ReadString());
+               strcpy(this.noise, ReadString());
                if(this.noise != "")
                {
                        this.atten = ReadByte() / 64.0;
                        this.volume = ReadByte() / 255.0;
                }
-               this.bgmscript = strzone(ReadString());
+               strcpy(this.bgmscript, ReadString());
                if(this.bgmscript != "")
                {
                        this.bgmscriptattack = ReadByte() / 64.0;