if(trace_startsolid || trace_fraction < 1)
onground = 1;
}
- animdecide_init(self);
+ animdecide_load_if_needed(self);
animdecide_setimplicitstate(self, onground);
animdecide_setframes(self, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
float sf = 0;
.vector anim_duckwalkbackleft;
.float animdecide_modelindex;
-void animdecide_init(entity e)
+void animdecide_load_if_needed(entity e)
{
if(e.modelindex == e.animdecide_modelindex)
return;
-// client side frame inferring
-void animdecide_init(entity e);
+// must be called at least once to initialize, or when modelindex is changed
+void animdecide_load_if_needed(entity e);
+// client side frame inferring
void animdecide_setimplicitstate(entity e, float onground);
void animdecide_setframes(entity e, float support_blending, .float fld_frame, .float fld_frame1time, .float fld_frame2, .float fld_frame2time);
self.nextthink = time;
self.think = CopyBody_Think;
// "bake" the current animation frame for clones (they don't get clientside animation)
- animdecide_init(self);
+ animdecide_load_if_needed(self);
animdecide_setframes(self, FALSE, frame, frame1time, frame2, frame2time);
self = oldself;
void player_setupanimsformodel()
{
// load animation info
- animdecide_init(self);
+ animdecide_load_if_needed(self);
animdecide_setstate(self, 0, FALSE);
}