fix iqm crash bug.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5124 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-07-02 23:45:04 +00:00
parent 2b3d8b39e4
commit 9221a1a6ae

View file

@ -1095,6 +1095,11 @@ static int Alias_FindRawSkelData(galiasinfo_t *inf, framestate_t *fstate, skelle
if (cbone <= firstbone || endbone > lastbone)
{
lerps->firstbone = max(cbone, firstbone);
lerps->endbone = max(lerps->firstbone, min(endbone, lastbone));
if (lerps->firstbone == lerps->endbone)
continue;
if (!inf->numanimations || !Alias_BuildSkelLerps(lerps, &fstate->g[bonegroup], inf->numbones, inf)) //if there's no animations in this model, use the base pose instead.
{
if (!inf->baseframeofs)
@ -1104,8 +1109,6 @@ static int Alias_FindRawSkelData(galiasinfo_t *inf, framestate_t *fstate, skelle
lerps->pose[0] = inf->baseframeofs;
lerps->lerpcount = 1;
}
lerps->firstbone = max(cbone, firstbone);
lerps->endbone = min(endbone, lastbone);
numbonegroups++;
lerps++;
}