//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Change the position of a 3D sound @param nID ID of the sound @param v3d Three component vector cotaining the position @see CScriptObjectSound::Load3DSound */
| 798 | @see CScriptObjectSound::Load3DSound |
| 799 | */ |
| 800 | int 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 |
nothing calls this directly
no test coverage detected