From: havoc Date: Fri, 11 Feb 2005 05:38:37 +0000 (+0000) Subject: slight safety improvement in frameblend generation, may fix a crash Willis reported... X-Git-Tag: xonotic-v0.1.0preview~5153 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5648ea4628805cef3e6b14fde5a29dfcfebb3593;p=xonotic%2Fdarkplaces.git slight safety improvement in frameblend generation, may fix a crash Willis reported in Nexuiz git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5013 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_lerpanim.c b/r_lerpanim.c index b9f30a7f..f736a11c 100644 --- a/r_lerpanim.c +++ b/r_lerpanim.c @@ -68,13 +68,8 @@ void R_LerpAnimation(entity_render_t *r) sub1 = (sub1 % scene->framecount); sub2 = (sub2 % scene->framecount); } - else - { - sub1 = bound(0, sub1, (scene->framecount - 1)); - sub2 = bound(0, sub2, (scene->framecount - 1)); - } - sub1 += scene->firstframe; - sub2 += scene->firstframe; + sub1 = bound(0, sub1, (scene->framecount - 1)) + scene->firstframe; + sub2 = bound(0, sub2, (scene->framecount - 1)) + scene->firstframe; f = sub1; d = (1 - sublerp) * lerp; #define FRAMEBLENDINSERT\ @@ -128,13 +123,8 @@ void R_LerpAnimation(entity_render_t *r) sub1 = (sub1 % scene->framecount); sub2 = (sub2 % scene->framecount); } - else - { - sub1 = bound(0, sub1, (scene->framecount - 1)); - sub2 = bound(0, sub2, (scene->framecount - 1)); - } - sub1 += scene->firstframe; - sub2 += scene->firstframe; + sub1 = bound(0, sub1, (scene->framecount - 1)) + scene->firstframe; + sub2 = bound(0, sub2, (scene->framecount - 1)) + scene->firstframe; f = sub1; d = (1 - sublerp) * lerp; FRAMEBLENDINSERT