]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/impulse.qc
Introduce touch accessors
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / impulse.qc
index b7cd57272dce363c57e103f755e6a126c165019a..02c253eb78758cebe3f9e0c40eaa98709896915b 100644 (file)
@@ -179,41 +179,40 @@ bool trigger_impulse_send(entity this, entity to, int sf)
        return true;
 }
 
-void trigger_impulse_link()
+void trigger_impulse_link(entity this)
 {
-    SELFPARAM();
-       trigger_link(self, trigger_impulse_send);
+       trigger_link(this, trigger_impulse_send);
 }
 
 spawnfunc(trigger_impulse)
 {
-       self.active = ACTIVE_ACTIVE;
+       this.active = ACTIVE_ACTIVE;
 
-       trigger_init(self);
+       trigger_init(this);
 
-       if(self.radius)
+       if(this.radius)
        {
-               if(!self.strength) self.strength = 2000 * autocvar_g_triggerimpulse_radial_multiplier;
-               setorigin(self, self.origin);
-               setsize(self, '-1 -1 -1' * self.radius,'1 1 1' * self.radius);
-               self.touch = trigger_impulse_touch3;
+               if(!this.strength) this.strength = 2000 * autocvar_g_triggerimpulse_radial_multiplier;
+               setorigin(this, this.origin);
+               setsize(this, '-1 -1 -1' * this.radius,'1 1 1' * this.radius);
+               settouch(this, trigger_impulse_touch3);
        }
        else
        {
-               if(self.target)
+               if(this.target)
                {
-                       if(!self.strength) self.strength = 950 * autocvar_g_triggerimpulse_directional_multiplier;
-                       self.touch = trigger_impulse_touch1;
+                       if(!this.strength) this.strength = 950 * autocvar_g_triggerimpulse_directional_multiplier;
+                       settouch(this, trigger_impulse_touch1);
                }
                else
                {
-                       if(!self.strength) self.strength = 0.9;
-                       self.strength = pow(self.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
-                       self.touch = trigger_impulse_touch2;
+                       if(!this.strength) this.strength = 0.9;
+                       this.strength = pow(this.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
+                       settouch(this, trigger_impulse_touch2);
                }
        }
 
-       trigger_impulse_link();
+       trigger_impulse_link(this);
 }
 #elif defined(CSQC)
 NET_HANDLE(ENT_CLIENT_TRIGGER_IMPULSE, bool isnew)
@@ -224,7 +223,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_IMPULSE, bool isnew)
        this.falloff = ReadByte();
        this.active = ReadByte();
 
-       trigger_common_read(true);
+       trigger_common_read(this, true);
        return = true;
 
        this.classname = "trigger_impulse";