]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow each path_corner to override the moving type of the train. 0 doesn't override...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 22 May 2012 15:46:09 +0000 (18:46 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 22 May 2012 15:46:09 +0000 (18:46 +0300)
qcsrc/server/t_plats.qc

index 3e8d077af707a82bb48155e0fbfdd1d866e6aaf6..753ab02fa8729c14b6270079e4960af7f3c52db3 100644 (file)
@@ -252,6 +252,7 @@ void spawnfunc_func_plat()
 }
 
 .float train_wait_turning;
+.float platmovetype_default;
 void() train_next;
 void train_wait()
 {
@@ -312,6 +313,19 @@ void train_next()
        if (!self.wait)
                self.wait = 0.1;
 
+       switch(targ.platmovetype)
+       {
+               case 0: // no override
+                       self.platmovetype = self.platmovetype_default;
+                       break;
+               case 1: // linear
+                       self.platmovetype = 0;
+                       break;
+               case 2: // cosine
+                       self.platmovetype = 1;
+                       break;
+       }
+
        if (targ.speed)
        {
                if (self.spawnflags & 1)
@@ -375,6 +389,7 @@ void spawnfunc_func_train()
        if(self.dmg && (!self.dmgtime))
                self.dmgtime = 0.25;
        self.dmgtime2 = time;
+       self.platmovetype_default = self.platmovetype; // used for path_corner overrides
 
        // TODO make a reset function for this one
 }