engine: client: support vox sentence that starts with leading slash

This commit is contained in:
Alibek Omarov 2024-10-14 04:12:45 +03:00
parent 8452bec877
commit 4ec6c2f7cf

View file

@ -248,6 +248,12 @@ static const char *VOX_GetDirectory( char *szpath, const char *psz, int nsize )
const char *p; const char *p;
int len; int len;
// HACKHACK: some modders send strings like "/fvox/_period four"
// which should get parsed as "_period four" said by fvox
// it might be incorrect but ignore first slash here for now
if( psz[0] == '/' )
psz++;
// search / backwards // search / backwards
p = Q_strrchr( psz, '/' ); p = Q_strrchr( psz, '/' );
@ -595,8 +601,8 @@ static void Test_VOX_GetDirectory( void )
{ {
"", "", "vox/", "", "", "vox/",
"bark bark", "bark bark", "vox/", "bark bark", "bark bark", "vox/",
"barney/meow", "meow", "barney/" "barney/meow", "meow", "barney/",
"/fvox/_period", "_period", "fvox/",
}; };
int i; int i;