]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/bobbing.qc
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / bobbing.qc
index 094673b5bb4612f0b2dcb25f9b0afb7840ca42b0..b647e15a826e48164f03db46c5f62114a8e6afc6 100644 (file)
@@ -1,3 +1,4 @@
+#include "bobbing.qh"
 #ifdef SVQC
 .float height;
 void func_bobbing_controller_think(entity this)
@@ -16,7 +17,7 @@ void func_bobbing_controller_think(entity this)
        v = this.owner.destvec + this.owner.movedir * v_forward_y;
        if(this.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
-               this.owner.velocity = (v - this.owner.SUB_ORIGIN) * 10;
+               this.owner.velocity = (v - this.owner.origin) * 10;
 }
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
@@ -58,9 +59,9 @@ spawnfunc(func_bobbing)
        this.dmgtime2 = time;
 
        // how far to bob
-       if (this.spawnflags & 1) // X
+       if (this.spawnflags & BOBBING_XAXIS)
                this.movedir = '1 0 0' * this.height;
-       else if (this.spawnflags & 2) // Y
+       else if (this.spawnflags & BOBBING_YAXIS)
                this.movedir = '0 1 0' * this.height;
        else // Z
                this.movedir = '0 0 1' * this.height;
@@ -73,8 +74,8 @@ spawnfunc(func_bobbing)
        controller.owner = this;
        controller.nextthink = time + 1;
        setthink(controller, func_bobbing_controller_think);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink);
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink);
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;