REALLY fix the rocket trail interpolation
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sat, 13 Feb 2010 16:21:08 +0000 (16:21 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sat, 13 Feb 2010 16:21:08 +0000 (16:21 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8645 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/client/interpolate.qc
data/qcsrc/client/interpolate.qh
data/qcsrc/client/projectile.qc

index 2dbf1d0..5593570 100644 (file)
@@ -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;
index 7a3a87f..a048803 100644 (file)
@@ -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();
index 0b75351..cd1fe26 100644 (file)
@@ -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)