/////////////////////////////////////////////////////////////////////
| 2276 | |
| 2277 | ////////////////////////////////////////////////////////////////////////// |
| 2278 | int CScriptBind_Entity::SetAttachmentLight(IFunctionHandler* pH, int characterSlot, const char* attachmentName, SmartScriptTable lightTable, int flags) |
| 2279 | { |
| 2280 | GET_ENTITY; |
| 2281 | |
| 2282 | ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot); |
| 2283 | |
| 2284 | if (!pCharacter) |
| 2285 | { |
| 2286 | return pH->EndFunction(); |
| 2287 | } |
| 2288 | |
| 2289 | IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager(); |
| 2290 | IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName); |
| 2291 | |
| 2292 | if (!pIAttachment) |
| 2293 | { |
| 2294 | return pH->EndFunction(); |
| 2295 | } |
| 2296 | |
| 2297 | CDLight light; |
| 2298 | |
| 2299 | if (ParseLightParams(lightTable, light)) |
| 2300 | { |
| 2301 | CLightAttachment* pLightAttachment = new CLightAttachment(); |
| 2302 | pLightAttachment->LoadLight(light); |
| 2303 | |
| 2304 | pIAttachment->AddBinding(pLightAttachment); |
| 2305 | pIAttachment->HideAttachment(0); |
| 2306 | } |
| 2307 | |
| 2308 | return pH->EndFunction(); |
| 2309 | } |
| 2310 | |
| 2311 | int CScriptBind_Entity::SetAttachmentPos(IFunctionHandler* pH, int characterSlot, const char* attachmentName, Vec3 pos) |
| 2312 | { |
nothing calls this directly
no test coverage detected