return servertime - dt;
}
#endif
+
+#ifndef MENUQC
+.float skeletonmodelindex; // used to check if model has changed
+float Update_Skeleton(entity e)
+{
+ // updates the skeleton if needed, and returns the total number of bones
+ if(e.skeletonmodelindex != e.modelindex)
+ {
+ if(e.skeletonindex)
+ skel_delete(e.skeletonindex);
+ e.skeletonindex = skel_create(e.modelindex);
+ e.skeletonmodelindex = e.modelindex;
+ }
+ return skel_get_numbones(e.skeletonindex);
+}
+#endif
void Shutdown();
#ifndef MENUQC
-// returns the total number of tags on model v
-#define TOTAL_TAGS(v) skel_get_numbones(skel_create(v.modelindex)); skel_delete(v.modelindex)
+float Update_Skeleton(entity e);
// loops through the tags of model v using counter tagnum
-#define FOR_EACH_TAG(v) float tagnum, totaltags; totaltags = TOTAL_TAGS(v); for(tagnum = 0; tagnum < totaltags; tagnum++, gettaginfo(v, tagnum))
+#define FOR_EACH_TAG(v) float tagnum, tags; tags = Update_Skeleton(v); for(tagnum = 0; tagnum < tags; tagnum++, gettaginfo(v, tagnum))
#endif
#ifdef SVQC
void WriteApproxPastTime(float dst, float t);