Fix CBaseEntity::ScriptGetKeyValue() returning cached string on invalid input

This commit is contained in:
samisalreadytaken 2023-12-05 14:45:07 +03:00
parent 976eb23299
commit a6f9d0a0e2

View File

@ -10297,8 +10297,9 @@ bool CBaseEntity::ScriptAddOutput( const char *pszOutputName, const char *pszTar
const char *CBaseEntity::ScriptGetKeyValue( const char *pszKeyName )
{
static char szValue[128];
GetKeyValue( pszKeyName, szValue, sizeof(szValue) );
if ( GetKeyValue( pszKeyName, szValue, sizeof(szValue) ) )
return szValue;
return NULL;
}
//-----------------------------------------------------------------------------