From: Mircea Kitsune Date: Sat, 14 Jan 2012 14:34:10 +0000 (+0200) Subject: Fix animation breakage, and use a separate value similar to self.skeletonindex. I... X-Git-Tag: xonotic-v0.6.0~110^2^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=817b0228a91ad689ae5a5cc2400d5ac3b38c24f9;p=xonotic%2Fxonotic-data.pk3dir.git Fix animation breakage, and use a separate value similar to self.skeletonindex. I still don't get why the normal skeletonindex can't return the total number of bones however, given it's already used --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 5c9eaf0e1..0d07c9140 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2220,11 +2220,11 @@ 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); + if(e.qc_skeletonindex) + skel_delete(e.qc_skeletonindex); + e.qc_skeletonindex = skel_create(e.modelindex); e.skeletonmodelindex = e.modelindex; } - return skel_get_numbones(e.skeletonindex); + return skel_get_numbones(e.qc_skeletonindex); } #endif diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index d8400a3dc..d940833e5 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -292,6 +292,7 @@ float InterpretBoolean(string input); void Shutdown(); #ifndef MENUQC +.float qc_skeletonindex; // maintains a separate skeleton for checking, different than skeletonindex float Update_Skeleton(entity e); // loops through the tags of model v using counter tagnum #define FOR_EACH_TAG(v) float tagnum, tags; tags = Update_Skeleton(v); for(tagnum = 0; tagnum < tags; tagnum++, gettaginfo(v, tagnum))