engine: server: pre-process string before passing it to PhysicAPI AllocString, for compatibility with existing Xash3D games

This commit is contained in:
Alibek Omarov 2023-08-07 20:11:35 +03:00
parent e1cbf96100
commit 72fe214f49
1 changed files with 12 additions and 1 deletions

View File

@ -3219,7 +3219,18 @@ string_t GAME_EXPORT SV_AllocString( const char *szValue )
int cmp;
if( svgame.physFuncs.pfnAllocString != NULL )
return svgame.physFuncs.pfnAllocString( szValue );
{
string_t i;
newString = Mem_Malloc( svgame.stringspool, SV_ProcessString( NULL, szValue ));
SV_ProcessString( newString, szValue );
i = svgame.physFuncs.pfnAllocString( newString );
Mem_Free( newString );
return i;
}
#ifdef XASH_64BIT
cmp = 1;