Replicate %alphatexture from Gmod

This commit is contained in:
Yui 2025-03-24 17:15:38 -04:00 committed by GitHub
parent 40b8d398fb
commit 9055a01141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -528,9 +528,17 @@ public:
if ( pVMT->LoadFromBuffer( pMaterialName, buf ) ) if ( pVMT->LoadFromBuffer( pMaterialName, buf ) )
{ {
bFound = true; bFound = true;
if ( pVMT->FindKey("$translucent") || pVMT->FindKey("$alphatest") ) if ( pVMT->FindKey("$alphatest") || pVMT->FindKey("$translucent") || pVMT->FindKey("%alphatexture") )
{ {
KeyValues *pBaseTexture = pVMT->FindKey("$basetexture"); KeyValues *pBaseTexture = NULL;
if ( pVMT->FindKey("%alphatexture") )
{
pBaseTexture = pVMT->FindKey("%alphatexture");
}
else
{
pBaseTexture = pVMT->FindKey("$basetexture");
}
if ( pBaseTexture ) if ( pBaseTexture )
{ {
const char *pBaseTextureName = pBaseTexture->GetString(); const char *pBaseTextureName = pBaseTexture->GetString();