// remove any bolts that reference original surfaces, generated surfaces, or bones that aren't active anymore void G2_RemoveRedundantBolts(boltInfo_v &bltlist, surfaceInfo_v &slist, int *activeSurfaces, int *activeBones) { // walk the bolt list for (size_t i=0; i<bltlist.size(); i++) { // are we using this bolt? if ((bltlist[i].surfaceNumber != -1) || (bltlist[i].boneNumber != -1)) { // is this referenceing a surface? if (bltlist[i].surfaceNumber != -1) { // is this bolt looking at a generated surface? if (bltlist[i].surfaceType) { // yes, so look for it in the surface list if (!G2_FindOverrideSurface(bltlist[i].surfaceNumber, slist)) { // no - we want to remove this bolt, regardless of how many people are using it bltlist[i].boltUsed = 1; G2_Remove_Bolt(bltlist, i); } } // no, it's an original, so look for it in the active surfaces list { if (!activeSurfaces[bltlist[i].surfaceNumber]) { // no - we want to remove this bolt, regardless of how many people are using it bltlist[i].boltUsed = 1; G2_Remove_Bolt(bltlist, i); } } } // no, must be looking at a bone then else { // is that bone active then? if (!activeBones[bltlist[i].boneNumber]) { // no - we want to remove this bolt, regardless of how many people are using it bltlist[i].boltUsed = 1; G2_Remove_Bolt(bltlist, i); } } } } }
qboolean G2API_RemoveBolt(CGhoul2Info *ghlInfo, const int index) { if (ghlInfo) { return G2_Remove_Bolt( ghlInfo->mBltlist, index); } return qfalse; }
qboolean G2API_RemoveBolt(CGhoul2Info *ghlInfo, const int index) { if (ghlInfo) { // ensure we flush the cache ghlInfo->mSkelFrameNum = 0; return G2_Remove_Bolt( ghlInfo->mBltlist, index); } return qfalse; }