if(trace_startsolid || trace_fraction < 1)
onground = 1;
}
- animdecide_init(self); // FIXME only do this on model change
+ animdecide_init(self);
animdecide_setimplicitstate(self, onground);
animdecide_setframes(self, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
float sf = 0;
.vector anim_duckwalkforwardleft;
.vector anim_duckwalkbackright;
.vector anim_duckwalkbackleft;
+.float animdecide_modelindex;
void animdecide_init(entity e)
{
+ if(e.modelindex == e.animdecide_modelindex)
+ return;
+ e.animdecide_modelindex = e.modelindex;
+
vector none = '0 0 0';
e.anim_die1 = animfixfps(e, '0 1 0.5', none); // 2 seconds
e.anim_die2 = animfixfps(e, '1 1 0.5', none); // 2 seconds
self.lerpfrac = l24 * l24_13;
self.lerpfrac4 = (1 - l24) * l24_13;
self.lerpfrac3 = (1 - l13) * (1 - l24_13);
+ print(sprintf("Xframe=%d frame2=%d frame3=%d frame4=%d lerp=%f lerp3=%f lerp4=%f\n", self.frame, self.frame2, self.frame3, self.frame4, self.lerpfrac, self.lerpfrac3, self.lerpfrac4));
if(l24_13 == 0) // if frames 2/4 are not displayed, clear their frametime
{