fix a bug in the 1-frame case
authorRudolf Polzer <divverent@alientrap.org>
Tue, 21 Feb 2012 22:31:03 +0000 (23:31 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 21 Feb 2012 22:31:03 +0000 (23:31 +0100)
qcsrc/csqcmodellib/cl_model.qc

index b77507b..c54593b 100644 (file)
@@ -134,7 +134,10 @@ void CSQCModel_InterpolateAnimation_Do()
        }
        else
        {
-               self.lerpfrac = 1 - bound(0, (time - self.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
+               if(self.frame2time == 0) // if frame2 was not previously displayed, only frame1 can make sense
+                       self.lerpfrac = 0;
+               else
+                       self.lerpfrac = 1 - bound(0, (time - self.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
        }
 #endif
 }