]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add .float platmovetype, so platform entities can opt to choose traditional linear...
authorMaik Merten <maikmerten@googlemail.com>
Tue, 25 Jan 2011 18:33:17 +0000 (19:33 +0100)
committerMaik Merten <maikmerten@googlemail.com>
Tue, 25 Jan 2011 18:33:17 +0000 (19:33 +0100)
qcsrc/server/defs.qh
qcsrc/server/g_subs.qc

index 970c86af429ecf3c4ef267ca4ef62b145e1afcad..16c76c11e4d3bd5a4f7e15f321759ee6815cafc1 100644 (file)
@@ -77,6 +77,7 @@ float maxclients;
 //.float       style;
 //.float       skill;
 .float sounds;
+.float  platmovetype;
 
 .string killtarget;
 
index 79369b74b9553dbcca2c0859560d46341c7b6111..6c4089c83bf645776098a9b06820f548b409d70a 100644 (file)
@@ -247,9 +247,12 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func)
                return;
        }
 
-       // very short animations don't really show off the effect
-       // of controlled animation, so let's just use linear movement
-       if (traveltime < 0.15)
+       // Very short animations don't really show off the effect
+       // of controlled animation, so let's just use linear movement.
+       // Alternatively entities can choose to specify non-controlled movement.
+       // The default, controlled movement, is value 0, the only currently
+       // implemented alternative movement is linear, which is any other value.
+       if (traveltime < 0.15 || self.platmovetype)
        {
                self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division
                self.nextthink = self.ltime + traveltime;