mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-10 20:11:42 +00:00
r_alias.c: (R_DrawAliasModel): avoid a possible undefined behavior.
See https://github.com/Novum/vkQuake/issues/476 for original discussion.
This commit is contained in:
parent
74f1621e0f
commit
57a32b567f
1 changed files with 3 additions and 4 deletions
|
@ -632,7 +632,7 @@ R_DrawAliasModel -- johnfitz -- almost completely rewritten
|
|||
void R_DrawAliasModel (entity_t *e)
|
||||
{
|
||||
aliashdr_t *paliashdr;
|
||||
int i, anim, skinnum;
|
||||
int anim, skinnum;
|
||||
gltexture_t *tx, *fb;
|
||||
lerpdata_t lerpdata;
|
||||
qboolean alphatest = !!(e->model->flags & MF_HOLEY);
|
||||
|
@ -712,9 +712,8 @@ void R_DrawAliasModel (entity_t *e)
|
|||
fb = paliashdr->fbtextures[skinnum][anim];
|
||||
if (e->colormap != vid.colormap && !gl_nocolors.value)
|
||||
{
|
||||
i = e - cl_entities;
|
||||
if (i >= 1 && i<=cl.maxclients /* && !strcmp (currententity->model->name, "progs/player.mdl") */)
|
||||
tx = playertextures[i - 1];
|
||||
if ((uintptr_t)e >= (uintptr_t)&cl_entities[1] && (uintptr_t)e <= (uintptr_t)&cl_entities[cl.maxclients]) /* && !strcmp (currententity->model->name, "progs/player.mdl") */
|
||||
tx = playertextures[e - cl_entities - 1];
|
||||
}
|
||||
if (!gl_fullbrights.value)
|
||||
fb = NULL;
|
||||
|
|
Loading…
Reference in a new issue