fixed a crash with r_lerpsprites 0 mode
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 13 Jan 2004 22:14:48 +0000 (22:14 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 13 Jan 2004 22:14:48 +0000 (22:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3808 d7cf8633-e32d-0410-b094-e92efae38249

r_sprites.c

index 5529c24..d215d49 100644 (file)
@@ -131,9 +131,12 @@ void R_DrawSpriteModelCallback(const void *calldata1, int calldata2)
                for (i = 0;i < 4 && ent->frameblend[i].lerp;i++)
                        frame = ent->model->sprite.sprdata_frames + ent->frameblend[i].frame;
 
-               R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha);
-               if (fog * ent->frameblend[i].lerp >= 0.01f)
-                       R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha);
+               if (frame)
+               {
+                       R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha);
+                       if (fog * ent->frameblend[i].lerp >= 0.01f)
+                               R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha);
+               }
        }
 }