Skip to content

Commit

Permalink
Merge pull request #842 from StrixG/fix/setsoundpanningenabled
Browse files Browse the repository at this point in the history
Fix setSoundPanningEnabled not working when using it right after playSound3D
  • Loading branch information
qaisjp committed Mar 3, 2019
2 parents 56ead0b + 21a2c40 commit b061dfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Client/mods/deathmatch/logic/CClientSound.cpp
Expand Up @@ -524,10 +524,13 @@ float* CClientSound::GetWaveData(int iLength)
}
bool CClientSound::SetPanEnabled(bool bPan)
{
if (m_pAudio && m_b3D)
if (m_b3D)
{
m_pAudio->SetPanEnabled(bPan);
m_bPan = bPan;
if (m_pAudio)
{
m_pAudio->SetPanEnabled(bPan);
}
return true;
}
return false;
Expand Down
7 changes: 3 additions & 4 deletions Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Expand Up @@ -7949,8 +7949,7 @@ bool CStaticFunctionDefinitions::IsSoundPanEnabled(CClientSound& Sound)

bool CStaticFunctionDefinitions::SetSoundPanEnabled(CClientSound& Sound, bool bEnabled)
{
Sound.SetPanEnabled(bEnabled);
return true;
return Sound.SetPanEnabled(bEnabled);
}

bool CStaticFunctionDefinitions::GetSoundLevelData(CClientSound& Sound, DWORD& dwLeft, DWORD& dwRight)
Expand Down Expand Up @@ -9746,14 +9745,14 @@ CClientSearchLight* CStaticFunctionDefinitions::CreateSearchLight(CResource& Res
}

bool CStaticFunctionDefinitions::ResetAllSurfaceInfo()
{
{
g_pGame->GetWorld()->ResetAllSurfaceInfo();
return true;
}
bool CStaticFunctionDefinitions::ResetSurfaceInfo(short sSurfaceID)
{
if (sSurfaceID >= EColSurfaceValue::DEFAULT && sSurfaceID <= EColSurfaceValue::SIZE)
{
{
g_pGame->GetWorld()->ResetSurfaceInfo(sSurfaceID);
return true;
}
Expand Down

0 comments on commit b061dfd

Please sign in to comment.