]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/pendulum.qc
Step 5: complete
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / pendulum.qc
index e05b2a6fca08927c0e081f9e1e230a70ad1a0c45..f1fffd7b927f86e7084a32b457e161c46a5d391f 100644 (file)
@@ -3,21 +3,21 @@
 void func_pendulum_controller_think(entity this)
 {
        float v;
-       self.nextthink = time + 0.1;
+       this.nextthink = time + 0.1;
 
-       if (!(self.owner.active == ACTIVE_ACTIVE))
+       if (!(this.owner.active == ACTIVE_ACTIVE))
        {
-               self.owner.avelocity_x = 0;
+               this.owner.avelocity_x = 0;
                return;
        }
 
        // calculate sinewave using makevectors
-       makevectors((self.nextthink * self.owner.freq + self.owner.phase) * '0 360 0');
-       v = self.owner.speed * v_forward_y + self.cnt;
-       if(self.owner.classname == "func_pendulum") // don't brake stuff if the func_bobbing was killtarget'ed
+       makevectors((this.nextthink * this.owner.freq + this.owner.phase) * '0 360 0');
+       v = this.owner.speed * v_forward_y + this.cnt;
+       if(this.owner.classname == "func_pendulum") // don't brake stuff if the func_bobbing was killtarget'ed
        {
                // * 10 so it will arrive in 0.1 sec
-               self.owner.avelocity_z = (remainder(v - self.owner.angles_z, 360)) * 10;
+               this.owner.avelocity_z = (remainder(v - this.owner.angles_z, 360)) * 10;
        }
 }