X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_subs.qc;h=c311f3774f45f59c7ad934e6b5992e673c1b4f54;hb=ff52b5b146e83d1d61dc7304918fdb1f5b7d63f3;hp=79369b74b9553dbcca2c0859560d46341c7b6111;hpb=dcaa708cee1093798a651369d9fd46ad5074121e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 79369b74b..c311f3774 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -16,6 +16,9 @@ void spawnfunc_info_null (void) void setanim(entity e, vector anim, float looping, float override, float restart) { + if (!anim) + return; // no animation was given to us! We can't use this. + if (anim_x == e.animstate_startframe) if (anim_y == e.animstate_numframes) if (anim_z == e.animstate_framerate) @@ -247,9 +250,11 @@ 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 only currently implemented alternative movement is linear (value 1) + if (traveltime < 0.15 || self.platmovetype == 1) { self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division self.nextthink = self.ltime + traveltime; @@ -260,7 +265,7 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func) controller.classname = "SUB_CalcMove_controller"; controller.owner = self; controller.origin = self.origin; // starting point - controller.finaldest = (tdest + '0 0 1'); // where do we want to end? Offset to overshoot a bit. + controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit. controller.destvec = delta; controller.animstate_starttime = time; controller.animstate_endtime = time + traveltime;