]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/bobbing.qc
Merge branch 'terencehill/quickmenu_file_example' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / bobbing.qc
index f671b8ac31312419a914bd3049ecd68da2832b16..909f5cd975c59381fc5ded443c4ae578466f35f4 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef SVQC
 .float height;
 void func_bobbing_controller_think()
-{
+{SELFPARAM();
        vector v;
        self.nextthink = time + 0.1;
 
@@ -16,7 +16,7 @@ void func_bobbing_controller_think()
        v = self.owner.destvec + self.owner.movedir * v_forward_y;
        if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
-               self.owner.velocity = (v - self.owner.origin) * 10;
+               self.owner.velocity = (v - self.owner.SUB_ORIGIN) * 10;
 }
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
@@ -28,7 +28,7 @@ noise : path/name of looping .wav file to play.
 dmg : Do this mutch dmg every .dmgtime intervall when blocked
 dmgtime : See above.
 */
-void spawnfunc_func_bobbing()
+spawnfunc(func_bobbing)
 {
        entity controller;
        if (self.noise != "")
@@ -69,13 +69,12 @@ void spawnfunc_func_bobbing()
                return;
 
        // wait for targets to spawn
-       controller = spawn();
-       controller.classname = "func_bobbing_controller";
+       controller = new(func_bobbing_controller);
        controller.owner = self;
        controller.nextthink = time + 1;
        controller.think = func_bobbing_controller_think;
-       self.nextthink = self.ltime + 999999999;
-       self.think = SUB_NullThink; // for PushMove
+       self.SUB_NEXTTHINK = self.SUB_LTIME + 999999999;
+       self.SUB_THINK = SUB_NullThink;
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        self.effects |= EF_LOWPRECISION;