OpenGL2: Fix MD3 surface with zero shaders dividing by zero

Reported by @DescX.
This commit is contained in:
Zack Middleton 2017-10-04 21:00:00 -05:00
parent ac4802af8d
commit d824cfa5a2

View file

@ -376,12 +376,9 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
else if (shader->defaultShader) {
ri.Printf( PRINT_DEVELOPER, "WARNING: shader %s in skin %s not found\n", shader->name, skin->name);
}
//} else if ( surface->numShaders <= 0 ) {
//shader = tr.defaultShader;
} else if ( surface->numShaderIndexes <= 0 ) {
shader = tr.defaultShader;
} else {
//md3Shader = (md3Shader_t *) ( (byte *)surface + surface->ofsShaders );
//md3Shader += ent->e.skinNum % surface->numShaders;
//shader = tr.shaders[ md3Shader->shaderIndex ];
shader = tr.shaders[ surface->shaderIndexes[ ent->e.skinNum % surface->numShaderIndexes ] ];
}