From bb209357c2606a912d29ed41e0305ff60318ac7f Mon Sep 17 00:00:00 2001 From: Yui <50331474+SirYodaJedi@users.noreply.github.com> Date: Mon, 24 Mar 2025 20:19:30 -0400 Subject: [PATCH] VRAD - reduce duplicate %alphatexture searches Per comment on https://github.com/ValveSoftware/source-sdk-2013/pull/1150 by @ficool2 --- sp/src/utils/vrad/vradstaticprops.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sp/src/utils/vrad/vradstaticprops.cpp b/sp/src/utils/vrad/vradstaticprops.cpp index ebd77326..3a812da6 100644 --- a/sp/src/utils/vrad/vradstaticprops.cpp +++ b/sp/src/utils/vrad/vradstaticprops.cpp @@ -528,14 +528,10 @@ public: if ( pVMT->LoadFromBuffer( pMaterialName, buf ) ) { bFound = true; - if ( pVMT->FindKey("$alphatest") || pVMT->FindKey("$translucent") || pVMT->FindKey("%alphatexture") ) + KeyValues *pBaseTexture = pVMT->FindKey("%alphatexture"); + if ( pBaseTexture || pVMT->FindKey("$alphatest") || pVMT->FindKey("$translucent") ) { - KeyValues *pBaseTexture = NULL; - if ( pVMT->FindKey("%alphatexture") ) - { - pBaseTexture = pVMT->FindKey("%alphatexture"); - } - else + if ( !pBaseTexture ) { pBaseTexture = pVMT->FindKey("$basetexture"); }