materialsystem: fix undefined behaviour(bruh moment)

This commit is contained in:
nillerusr
2021-10-05 00:53:56 +03:00
parent 2f12021cce
commit 0d2a493312
4 changed files with 161 additions and 30 deletions

View File

@@ -2378,15 +2378,12 @@ void CMaterial::ReloadTextures( void )
IMaterialVar **ppVars = GetShaderParams();
for( i = 0; i < nParams; i++ )
{
if( ppVars[i] )
if( ppVars[i] )
{
if( ppVars[i]->IsTexture() )
{
ITextureInternal *pTexture = ( ITextureInternal * )ppVars[i]->GetTextureValue();
if( !IsTextureInternalEnvCubemap( pTexture ) )
{
pTexture->Download();
}
pTexture->Download();
}
}
}