/////////////////////////////////////////////////////////////////////
| 2247 | |
| 2248 | ////////////////////////////////////////////////////////////////////////// |
| 2249 | int CScriptBind_Entity::SetAttachmentCGF(IFunctionHandler* pH, int characterSlot, const char* attachmentName, const char* filePath) |
| 2250 | { |
| 2251 | GET_ENTITY; |
| 2252 | |
| 2253 | ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot); |
| 2254 | |
| 2255 | if (!pCharacter) |
| 2256 | return pH->EndFunction(); |
| 2257 | |
| 2258 | IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager(); |
| 2259 | IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName); |
| 2260 | |
| 2261 | if (!pIAttachment) |
| 2262 | return pH->EndFunction(); |
| 2263 | |
| 2264 | if (IStatObj* pIStatObj = gEnv->p3DEngine->LoadStatObj(filePath)) |
| 2265 | { |
| 2266 | CCGFAttachment* pStatAttachment = new CCGFAttachment(); |
| 2267 | pStatAttachment->pObj = pIStatObj; |
| 2268 | |
| 2269 | pIAttachment->AddBinding(pStatAttachment); |
| 2270 | } |
| 2271 | |
| 2272 | pIAttachment->HideAttachment(0); |
| 2273 | |
| 2274 | return pH->EndFunction(); |
| 2275 | } |
| 2276 | |
| 2277 | ////////////////////////////////////////////////////////////////////////// |
| 2278 | int CScriptBind_Entity::SetAttachmentLight(IFunctionHandler* pH, int characterSlot, const char* attachmentName, SmartScriptTable lightTable, int flags) |
nothing calls this directly
no test coverage detected