From: Mircea Kitsune Date: Tue, 22 May 2012 15:46:09 +0000 (+0300) Subject: Allow each path_corner to override the moving type of the train. 0 doesn't override... X-Git-Tag: xonotic-v0.8.0~295^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cb015fa68b55782bd551a1920249ee0b9a1952a4;p=xonotic%2Fxonotic-data.pk3dir.git Allow each path_corner to override the moving type of the train. 0 doesn't override, 1 sets to linear, 2 sets to cosine --- diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 3e8d077af..753ab02fa 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -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 }