From 53ce2bdb66d60eca691eaf01a09cfe108506c90a Mon Sep 17 00:00:00 2001 From: jhh8 Date: Tue, 18 Nov 2025 19:54:04 +0200 Subject: [PATCH] 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 --- src/game/server/baseentity.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/game/server/baseentity.cpp b/src/game/server/baseentity.cpp index c1b1ce100..f455f6237 100644 --- a/src/game/server/baseentity.cpp +++ b/src/game/server/baseentity.cpp @@ -7279,7 +7279,20 @@ void CBaseEntity::InputRunScriptFile( inputdata_t& inputdata ) //--------------------------------------------------------- void CBaseEntity::InputRunScript( inputdata_t& inputdata ) { - RunScript( inputdata.value.String(), "InputRunScript" ); + const char *pszRawScriptCode = inputdata.value.String(); + + const int nRawScriptCodeLen = V_strlen( pszRawScriptCode ); + const int nRawScriptCodeSize = nRawScriptCodeLen + 1; + + CUtlString szScriptCode; + szScriptCode.SetLength( nRawScriptCodeLen ); + if ( V_StrSubst( inputdata.value.String(), "`", "\"", szScriptCode.Get(), nRawScriptCodeSize, true ) ) + { + RunScript( szScriptCode.Get(), "InputRunScript" ); + return; + } + + RunScript( pszRawScriptCode, "InputRunScript" ); } //---------------------------------------------------------