git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6435
d7cf8633-e32d-0410-b094-
e92efae38249
if (s > 0)
t = t + s * model->num_surfaces;
if (t->animated)
- t = t->anim_frames[ent->frame != 0][(t->anim_total[ent->frame != 0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[ent->frame != 0]) : 0];
+ {
+ // use an alternate animation if the entity's frame is not 0,
+ // and only if the texture has an alternate animation
+ if (ent->frame != 0 && t->anim_total[1])
+ t = t->anim_frames[1][(t->anim_total[1] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[1]) : 0];
+ else
+ t = t->anim_frames[0][(t->anim_total[0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[0]) : 0];
+ }
texture->currentframe = t;
}