Skip to content

Commit 53ce2bd

Browse files
committed
replace acute symbol with quote symbol when parsing a runscript string
so that you can write the acute symbol in hammer runscriptcode parameter field which gets turned into a quote symbol where otherwise writing a quote symbol directly breaks the vmf parsing in hammer
1 parent bdc69f7 commit 53ce2bd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/game/server/baseentity.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7279,7 +7279,20 @@ void CBaseEntity::InputRunScriptFile( inputdata_t& inputdata )
72797279
//---------------------------------------------------------
72807280
void CBaseEntity::InputRunScript( inputdata_t& inputdata )
72817281
{
7282-
RunScript( inputdata.value.String(), "InputRunScript" );
7282+
const char *pszRawScriptCode = inputdata.value.String();
7283+
7284+
const int nRawScriptCodeLen = V_strlen( pszRawScriptCode );
7285+
const int nRawScriptCodeSize = nRawScriptCodeLen + 1;
7286+
7287+
CUtlString szScriptCode;
7288+
szScriptCode.SetLength( nRawScriptCodeLen );
7289+
if ( V_StrSubst( inputdata.value.String(), "`", "\"", szScriptCode.Get(), nRawScriptCodeSize, true ) )
7290+
{
7291+
RunScript( szScriptCode.Get(), "InputRunScript" );
7292+
return;
7293+
}
7294+
7295+
RunScript( pszRawScriptCode, "InputRunScript" );
72837296
}
72847297

72857298
//---------------------------------------------------------

0 commit comments

Comments
 (0)