mat_stub 1 crashes the game
I do not know the exact cause of the crash, but I did notice that the stub system is optional: https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/client/cdll_client_int.cpp#L729
This code needs to check the validity properly: https://github.com/VSES/SourceEngine2007/blob/43a5c90a5ada1e69ca044595383be67f40b33c61/se2007/game/client/cdll_client_int.cpp#L729
Like this:
CMatStubHandler::CMatStubHandler()
{
if ( mat_stub.GetInt() )
{
IMaterialSystemStub* pStub = GetStubMaterialSystem();
if ( pStub != NULL )
{
m_pOldMaterialSystem = materials;
// Replace all material system pointers with the stub.
pStub->SetRealMaterialSystem( materials );
materials->SetInStubMode( true );
materials = pStub;
engine->Mat_Stub( materials );
}
else
{
m_pOldMaterialSystem = 0;
}
}
else
{
m_pOldMaterialSystem = 0;
}
}
That's most likely not the cause of the crash though. Credit to @hellokittyhoodie for finding.
I wouldn't consider this a big deal, it's a cheat only cvar that doesn't save. (And yes, that isn't the cause of the crash)
This was apparently already fixed, but I will also be removing the convar entirely, no purpose for it to exist as far as I can see.