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

This commit is contained in:
samisalreadytaken
2024-02-02 17:06:25 +03:00
parent 976eb23299
commit a6f9d0a0e2
+3 -2
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) );
return szValue;
if ( GetKeyValue( pszKeyName, szValue, sizeof(szValue) ) )
return szValue;
return NULL;
}
//-----------------------------------------------------------------------------