FOR_EACH_TAG(self)
{
// go through all tags on the player model, choose the one closest to the damage origin
- if(!closest || vlen(hitorg - gettaginfo(self, i)) <= vlen(hitorg - gettaginfo(self, closest)))
- closest = i;
+ if(!closest || vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, closest)))
+ closest = tagnum;
}
gettaginfo(self, closest); // set gettaginfo_name
void Shutdown();
#ifndef MENUQC
-// loop that goes through all the bones of a model
-#define FOR_EACH_TAG(v) for(i = 1, gettaginfo(v, i);; i++, gettaginfo(v, i)) if not(gettaginfo_name) break; else
+// loops through the tags of model v using counter tagnum
+#define FOR_EACH_TAG(v) float tagnum; for(tagnum = 1, gettaginfo(v, tagnum);; tagnum++, gettaginfo(v, tagnum)) if not(gettaginfo_name) break; else
#endif