From 5338532798bd38d243dbb9d6e14f39ae317ccfca Mon Sep 17 00:00:00 2001 From: Night Owl Date: Sun, 11 Feb 2018 01:49:04 +0500 Subject: [PATCH] Fix playing mp3 in steam. --- cl_dll/hud.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 9e3ed4dd..5dc0e5a6 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -80,16 +80,29 @@ int __MsgFunc_GameMode( const char *pszName, int iSize, void *pbuf ) int __MsgFunc_PlayMP3( const char *pszName, int iSize, void *pbuf ) { + const char *pszSound; + char cmd[64]; + BEGIN_READ( pbuf, iSize ); + pszSound = READ_STRING(); - gEngfuncs.pfnPrimeMusicStream( READ_STRING(), 1 ); + if( !isXashFWGS() && gEngfuncs.pfnGetCvarPointer( "gl_overbright" ) ) + { + sprintf( cmd, "mp3 play %s\n", pszSound ); + gEngfuncs.pfnClientCmd( cmd ); + } + else + gEngfuncs.pfnPrimeMusicStream( pszSound, 1 ); - return 1; + return 1; } void __CmdFunc_StopMP3( void ) { - gEngfuncs.pfnPrimeMusicStream( 0, 0 ); + if( !isXashFWGS() && gEngfuncs.pfnGetCvarPointer( "gl_overbright" ) ) + gEngfuncs.pfnClientCmd( "mp3 stop\n" ); + else + gEngfuncs.pfnPrimeMusicStream( 0, 0 ); } // TFFree Command Menu