mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-07 02:09:52 +03:00
Merge pull request #230 from SanyaSho/patch/null-sprite-crash
Add missing NULL check from original MP branch
This commit is contained in:
@@ -417,6 +417,9 @@ IMaterial *CEngineSprite::GetMaterial( RenderMode_t nRenderMode, int nFrame )
|
|||||||
|
|
||||||
|
|
||||||
IMaterial *pMaterial = m_material[nRenderMode];
|
IMaterial *pMaterial = m_material[nRenderMode];
|
||||||
|
if( !pMaterial )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
IMaterialVar* pFrameVar = pMaterial->FindVarFast( "$frame", &frameCache );
|
IMaterialVar* pFrameVar = pMaterial->FindVarFast( "$frame", &frameCache );
|
||||||
if ( pFrameVar )
|
if ( pFrameVar )
|
||||||
{
|
{
|
||||||
@@ -539,4 +542,4 @@ void CEngineSprite::DrawFrameOfSize( RenderMode_t nRenderMode, int frame, int x,
|
|||||||
|
|
||||||
meshBuilder.End();
|
meshBuilder.End();
|
||||||
pMesh->Draw();
|
pMesh->Draw();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user