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

Method AttachObjectToBone

CrySystem/ScriptObjectEntity.cpp:1039–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1037}
1038
1039int CScriptObjectEntity::AttachObjectToBone(IFunctionHandler *pH)
1040{
1041 //CHECK_PARAMETERS(2); can be 2 or 3 or 4 params.
1042
1043 char *boneName;
1044 int slot;
1045 bool bMultipleAttachments = false;
1046 bool bUseZOffset = false;
1047 pH->GetParam(1,slot);
1048 pH->GetParam(2,boneName);
1049
1050 if (!pH->GetParam(3,bMultipleAttachments))
1051 bMultipleAttachments = false;
1052
1053 if (pH->GetParamCount()>=4 && !pH->GetParam(4,bUseZOffset))
1054 bUseZOffset = false;
1055
1056 BoneBindHandle boneHandler = m_pEntity->AttachObjectToBone(slot, boneName,bMultipleAttachments, bUseZOffset);
1057
1058 if (boneHandler == -1)
1059 {
1060 return pH->EndFunctionNull();
1061 }
1062
1063 if (bMultipleAttachments)
1064 {
1065 // Make user data for bone handler.
1066 USER_DATA ud = m_pScriptSystem->CreateUserData( boneHandler,USER_DATA_BONEHANDLER );
1067 return pH->EndFunction(ud);
1068 }
1069
1070 return pH->EndFunctionNull();
1071}
1072
1073int CScriptObjectEntity::DetachObjectToBone(IFunctionHandler *pH)
1074{

Callers

nothing calls this directly

Calls 5

EndFunctionNullMethod · 0.80
CreateUserDataMethod · 0.80
EndFunctionMethod · 0.80
GetParamMethod · 0.45
GetParamCountMethod · 0.45

Tested by

no test coverage detected