]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
platmovetype fixes
authorRudolf Polzer <divverent@xonotic.org>
Thu, 24 May 2012 13:41:59 +0000 (15:41 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 24 May 2012 13:41:59 +0000 (15:41 +0200)
qcsrc/server/g_subs.qc
qcsrc/server/t_plats.qc

index 5ac8f734826d6cf3f2929387bc3f7fefbe5e7aad..9454f14f49263ab45cd10acabb49a41e3103ba1c 100644 (file)
@@ -373,7 +373,7 @@ void SUB_CalcMove (vector tdest, float tspeedtype, float tspeed, void() func)
        // of controlled animation, so let's just use linear movement.
        // Alternatively entities can choose to specify non-controlled movement.
         // The only currently implemented alternative movement is linear (value 1)
-       if (traveltime < 0.15 || self.platmovetype_start || self.platmovetype_end) // is this correct?
+       if (traveltime < 0.15 || (self.platmovetype_start == 1 && self.platmovetype_end == 1)) // is this correct?
        {
                self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division
                self.nextthink = self.ltime + traveltime;
index 68a4fc57f1fc36a3622ba7ff8e12cb037347c7cf..beab82ae58449fef0b797b40899e93bb87dbc7a7 100644 (file)
@@ -348,7 +348,7 @@ void train_next()
        if (!self.wait)
                self.wait = 0.1;
 
-       if(targ.platmovetype_start || targ.platmovetype_end)
+       if(targ.platmovetype)
        {
                // this path_corner contains a movetype overrider, apply it
                self.platmovetype_start = targ.platmovetype_start;
@@ -425,7 +425,8 @@ void spawnfunc_func_train()
                self.dmgtime = 0.25;
        self.dmgtime2 = time;
 
-       set_platmovetype(self, self.platmovetype);
+       if(!set_platmovetype(self, self.platmovetype))
+               return;
        self.platmovetype_start_default = self.platmovetype_start;
        self.platmovetype_end_default = self.platmovetype_end;