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

Method AttachObjectToBone

CryEntitySystem/Entity.cpp:3198–3221  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3196//
3197//------------------------------------------------------------------
3198BoneBindHandle CEntity::AttachObjectToBone(int slot,const char* boneName,bool bMultipleAttachments, bool bUseZOffset )
3199{
3200 ICryCharInstance *character = GetCharInterface()->GetCharacter(PLAYER_MODEL_IDX);
3201
3202 if (character)
3203 {
3204 if (!bMultipleAttachments)
3205 {
3206 // Old way.
3207 // m_pSelectedInfo->pBindInfo =
3208 return character->AttachObjectToBone( GetIStatObj(slot),boneName, false, bUseZOffset ? ICryCharInstance::FLAGS_ATTACH_ZOFFSET : 0 );
3209 }
3210 else
3211 {
3212 // New way.
3213 int boneid = character->GetModel()->GetBoneByName(boneName);
3214 if (boneid >= 0)
3215 {
3216 return character->AttachToBone( GetIStatObj(slot),boneid, bUseZOffset ? ICryCharInstance::FLAGS_ATTACH_ZOFFSET : 0);
3217 }
3218 }
3219 }
3220 return -1;
3221}
3222
3223//
3224//------------------------------------------------------------------

Callers 2

AttachToBoneMethod · 0.45
DetachObjectToBoneMethod · 0.45

Calls 4

GetCharacterMethod · 0.45
GetBoneByNameMethod · 0.45
GetModelMethod · 0.45
AttachToBoneMethod · 0.45

Tested by

no test coverage detected