From 9221a1a6aee1b7cfa6b60c5e21f67197392c0eba Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 2 Jul 2017 23:45:04 +0000 Subject: [PATCH] fix iqm crash bug. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5124 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/com_mesh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/common/com_mesh.c b/engine/common/com_mesh.c index 4eb0499f4..5c5c68b35 100644 --- a/engine/common/com_mesh.c +++ b/engine/common/com_mesh.c @@ -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++; }