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

Method AttachObjectToBone

CryGame/ScriptObjectWeaponClass.cpp:789–809  ·  view source on GitHub ↗

------------------------------------------------------------------

Source from the content-addressed store, hash-verified

787
788//------------------------------------------------------------------
789int 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//------------------------------------------------------------------

Callers 3

DetachObjectToBoneMethod · 0.45
DrawThirdPersonWeaponMethod · 0.45

Calls 9

GetMuzzleFlashMethod · 0.80
CreateUserDataMethod · 0.80
EndFunctionMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamMethod · 0.45
GetCharacterMethod · 0.45
GetBoneByNameMethod · 0.45
GetModelMethod · 0.45
AttachToBoneMethod · 0.45

Tested by

no test coverage detected