Decals: Avoid attempting to cache and display decals with no yet-defined texture.

This commit is contained in:
Marco Cawthorne 2020-09-24 17:43:35 +02:00
parent b6e9aceb02
commit 365ac0a5fa

View file

@ -82,6 +82,10 @@ decal::predraw(void)
return PREDRAW_NEXT;
}
/* skip empty decals */
if (!dcl.m_strShader)
return;
/* don't draw us, unnecessary */
/*if (checkpvs(getproperty(VF_ORIGIN), this) == FALSE) {
return PREDRAW_NEXT;
@ -96,6 +100,11 @@ void
decal::BuildShader(void)
{
string shader_buff;
/* skip empty decals */
if (!m_strTexture)
return;
m_strShader = sprintf("decal_%s", m_strTexture);
shader_buff = sprintf(g_decal_shader, m_strTexture);
shaderforname(m_strShader, shader_buff);