Skip to content

Commit 82d3818

Browse files
Fix CBaseEntity::ScriptGetKeyValue() returning cached string on invalid input
1 parent a1a6c49 commit 82d3818

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sp/src/game/server/baseentity.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10297,8 +10297,9 @@ bool CBaseEntity::ScriptAddOutput( const char *pszOutputName, const char *pszTar
1029710297
const char *CBaseEntity::ScriptGetKeyValue( const char *pszKeyName )
1029810298
{
1029910299
static char szValue[128];
10300-
GetKeyValue( pszKeyName, szValue, sizeof(szValue) );
10301-
return szValue;
10300+
if ( GetKeyValue( pszKeyName, szValue, sizeof(szValue) ) )
10301+
return szValue;
10302+
return NULL;
1030210303
}
1030310304

1030410305
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)