Browse Source

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

pull/2/head
Alibek Omarov 1 year ago
parent
commit
72fe214f49
  1. 13
      engine/server/sv_game.c

13
engine/server/sv_game.c

@ -3219,7 +3219,18 @@ string_t GAME_EXPORT SV_AllocString( const char *szValue ) @@ -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;

Loading…
Cancel
Save