------------------------------------------------------------------
| 787 | |
| 788 | //------------------------------------------------------------------ |
| 789 | int CScriptObjectWeaponClass::AttachObjectToBone(IFunctionHandler *pH) |
| 790 | { |
| 791 | char *boneName; |
| 792 | pH->GetParam(2, boneName); |
| 793 | |
| 794 | if (m_pWeaponClass->GetCharacter() && m_pWeaponClass->GetMuzzleFlash()) |
| 795 | { |
| 796 | int boneid = m_pWeaponClass->GetCharacter()->GetModel()->GetBoneByName(boneName); |
| 797 | if (boneid >= 0) |
| 798 | { |
| 799 | ICryCharInstance::ObjectBindingHandle boneHandler; |
| 800 | boneHandler = m_pWeaponClass->GetCharacter()->AttachToBone(m_pWeaponClass->GetMuzzleFlash(), boneid); |
| 801 | |
| 802 | // Make user data for bone handler. |
| 803 | USER_DATA ud = m_pScriptSystem->CreateUserData( boneHandler,USER_DATA_BONEHANDLER ); |
| 804 | return pH->EndFunction(ud); |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | return pH->EndFunctionNull(); |
| 809 | } |
| 810 | |
| 811 | // |
| 812 | //------------------------------------------------------------------ |
no test coverage detected