| 1037 | } |
| 1038 | |
| 1039 | int 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 | |
| 1073 | int CScriptObjectEntity::DetachObjectToBone(IFunctionHandler *pH) |
| 1074 | { |
nothing calls this directly
no test coverage detected