From 4215a9ed53e4027e4fa0477bf357c84381565271 Mon Sep 17 00:00:00 2001 From: div0 Date: Sat, 13 Feb 2010 16:21:08 +0000 Subject: [PATCH] REALLY fix the rocket trail interpolation git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8645 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/interpolate.qc | 5 +++++ data/qcsrc/client/interpolate.qh | 3 +++ data/qcsrc/client/projectile.qc | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/client/interpolate.qc b/data/qcsrc/client/interpolate.qc index 2dbf1d06e..559357050 100644 --- a/data/qcsrc/client/interpolate.qc +++ b/data/qcsrc/client/interpolate.qc @@ -4,6 +4,11 @@ .vector iforward1, iforward2; .vector iup1, iup2; .float itime1, itime2; +void InterpolateOrigin_Reset() +{ + self.iflags &~= (IFLAG_PREVALID | IFLAG_VALID); + self.itime1 = self.itime2 = 0; +} void InterpolateOrigin_Note() { float dt; diff --git a/data/qcsrc/client/interpolate.qh b/data/qcsrc/client/interpolate.qh index 7a3a87f7f..a0488038c 100644 --- a/data/qcsrc/client/interpolate.qh +++ b/data/qcsrc/client/interpolate.qh @@ -12,5 +12,8 @@ void InterpolateOrigin_Undo(); // call this AFTER receiving an entity update void InterpolateOrigin_Note(); +// call this when the entity got teleported, before InterpolateOrigin_Note +void InterpolateOrigin_Reset(); + // call this BEFORE drawing void InterpolateOrigin_Do(); diff --git a/data/qcsrc/client/projectile.qc b/data/qcsrc/client/projectile.qc index 0b75351bb..cd1fe267b 100644 --- a/data/qcsrc/client/projectile.qc +++ b/data/qcsrc/client/projectile.qc @@ -1,3 +1,4 @@ +.vector iorigin1, iorigin2; .float spawntime; .vector trail_oldorigin; .float trail_oldtime; @@ -217,8 +218,9 @@ void Ent_Projectile() if(time == self.spawntime || (self.count & 0x80) || (f & 0x10)) { - print("TELE\n"); self.trail_oldorigin = self.origin; + if(!(self.count & 0x80)) + InterpolateOrigin_Reset(); } if(f & 0x20) -- 2.39.2