@@ -23,9 +23,11 @@ int CLuaFunctionDefs::PlaySound ( lua_State* luaVM )
2323{
2424 SString strSound = " " ;
2525 bool bLoop = false ;
26+ bool bThrottle = true ;
2627 CScriptArgReader argStream ( luaVM );
2728 argStream.ReadString ( strSound );
2829 argStream.ReadBool ( bLoop, false );
30+ argStream.ReadBool ( bThrottle, true );
2931
3032 if ( !argStream.HasErrors () )
3133 {
@@ -46,7 +48,7 @@ int CLuaFunctionDefs::PlaySound ( lua_State* luaVM )
4648 // Fixes #6507 - Caz
4749 if ( pResource )
4850 {
49- CClientSound* pSound = CStaticFunctionDefinitions::PlaySound ( pResource, strSound, bIsURL, bLoop );
51+ CClientSound* pSound = CStaticFunctionDefinitions::PlaySound ( pResource, strSound, bIsURL, bLoop, bThrottle );
5052 if ( pSound )
5153 {
5254 // call onClientSoundStarted
@@ -74,10 +76,12 @@ int CLuaFunctionDefs::PlaySound3D ( lua_State* luaVM )
7476 SString strSound = " " ;
7577 CVector vecPosition;
7678 bool bLoop = false ;
79+ bool bThrottle = false ;
7780 CScriptArgReader argStream ( luaVM );
7881 argStream.ReadString ( strSound );
7982 argStream.ReadVector3D ( vecPosition );
8083 argStream.ReadBool ( bLoop, false );
84+ argStream.ReadBool ( bThrottle, true );
8185
8286 if ( !argStream.HasErrors () )
8387 {
@@ -98,7 +102,7 @@ int CLuaFunctionDefs::PlaySound3D ( lua_State* luaVM )
98102 // Fixes #6507 - Caz
99103 if ( pResource )
100104 {
101- CClientSound* pSound = CStaticFunctionDefinitions::PlaySound3D ( pResource, strSound, bIsURL, vecPosition, bLoop );
105+ CClientSound* pSound = CStaticFunctionDefinitions::PlaySound3D ( pResource, strSound, bIsURL, vecPosition, bLoop, bThrottle );
102106 if ( pSound )
103107 {
104108 // call onClientSoundStarted
0 commit comments