From 4ec6c2f7cf307553056753266235b2d87d52fa81 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 14 Oct 2024 04:12:45 +0300 Subject: [PATCH] engine: client: support vox sentence that starts with leading slash --- engine/client/s_vox.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/client/s_vox.c b/engine/client/s_vox.c index 0d8b7d3a..a72f642e 100644 --- a/engine/client/s_vox.c +++ b/engine/client/s_vox.c @@ -248,6 +248,12 @@ static const char *VOX_GetDirectory( char *szpath, const char *psz, int nsize ) const char *p; 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 p = Q_strrchr( psz, '/' ); @@ -595,8 +601,8 @@ static void Test_VOX_GetDirectory( void ) { "", "", "vox/", "bark bark", "bark bark", "vox/", - "barney/meow", "meow", "barney/" - + "barney/meow", "meow", "barney/", + "/fvox/_period", "_period", "fvox/", }; int i;