------------------------------------------------------------------
| 3196 | // |
| 3197 | //------------------------------------------------------------------ |
| 3198 | BoneBindHandle 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 | //------------------------------------------------------------------ |
no test coverage detected