Fix mp3 playing in steam.

This commit is contained in:
Night Owl 2018-07-10 10:06:19 +05:00
parent 003ef5c414
commit 9e49b2fcf5

View File

@ -102,19 +102,33 @@ void __CmdFunc_ToggleServerBrowser( void )
int __MsgFunc_PlayMP3( const char *pszName, int iSize, void *pbuf ) int __MsgFunc_PlayMP3( const char *pszName, int iSize, void *pbuf )
{ {
const char *pszSound;
char cmd[64]; char cmd[64];
BEGIN_READ( pbuf, iSize ); BEGIN_READ( pbuf, iSize );
sprintf( cmd, "sound/mp3/%s", READ_STRING() ); pszSound = READ_STRING();
gEngfuncs.pfnPrimeMusicStream( cmd, 1 );
if( !IsXashFWGS() && gEngfuncs.pfnGetCvarPointer( "gl_overbright" ) )
{
sprintf( cmd, "mp3 play sound/mp3/%s\n", pszSound );
gEngfuncs.pfnClientCmd( cmd );
}
else
{
sprintf( cmd, "sound/mp3/%s", pszSound );
gEngfuncs.pfnPrimeMusicStream( cmd, 1 );
}
return 1; return 1;
} }
void __CmdFunc_StopMP3( void ) 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 Message Handlers // TFFree Command Menu Message Handlers