MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SetSoundPosition

Method SetSoundPosition

CrySystem/ScriptObjectSound.cpp:800–823  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Change the position of a 3D sound @param nID ID of the sound @param v3d Three component vector cotaining the position @see CScriptObjectSound::Load3DSound */

Source from the content-addressed store, hash-verified

798 @see CScriptObjectSound::Load3DSound
799*/
800int CScriptObjectSound::SetSoundPosition(IFunctionHandler *pH)
801{
802 CHECK_PARAMETERS(2);
803 int nCookie=0;
804 ISound *pSound=NULL;
805 CScriptObjectVector oVec(m_pScriptSystem,true);
806 Vec3 v3d;
807
808 pH->GetParamUDVal(1,(INT_PTR &)pSound,nCookie); //AMD Port
809
810 pH->GetParam(2,*oVec);
811 v3d=oVec.Get();
812
813 if (pSound && (nCookie==USER_DATA_SOUND))
814 {
815 // Prevent script from changing the position of relative sounds
816 if (pSound->IsRelative())
817 return pH->EndFunction();
818
819 pSound->SetPosition(v3d);
820 }
821
822 return pH->EndFunction();
823}
824/////////////////////////////////////////////////////////////////////////////////
825/////////////////////////////////////////////////////////////////////////////////
826/*! Change the velocity of a sound

Callers

nothing calls this directly

Calls 6

EndFunctionMethod · 0.80
GetParamUDValMethod · 0.45
GetParamMethod · 0.45
GetMethod · 0.45
IsRelativeMethod · 0.45
SetPositionMethod · 0.45

Tested by

no test coverage detected