| 2159 | } |
| 2160 | |
| 2161 | int CScriptBind_Entity::SetAttachmentEffect(IFunctionHandler* pH, int characterSlot, const char* attachmentName, const char* effectName, Vec3 offset, Vec3 dir, float scale, int flags) |
| 2162 | { |
| 2163 | GET_ENTITY; |
| 2164 | |
| 2165 | ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot); |
| 2166 | |
| 2167 | if (!pCharacter) |
| 2168 | { |
| 2169 | return pH->EndFunction(); |
| 2170 | } |
| 2171 | |
| 2172 | IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager(); |
| 2173 | IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName); |
| 2174 | |
| 2175 | if (!pIAttachment) |
| 2176 | { |
| 2177 | return pH->EndFunction(); |
| 2178 | } |
| 2179 | |
| 2180 | CEffectAttachment* pEffectAttachment = new CEffectAttachment(effectName, offset, dir, scale); |
| 2181 | |
| 2182 | pIAttachment->AddBinding(pEffectAttachment); |
| 2183 | pIAttachment->HideAttachment(0); |
| 2184 | |
| 2185 | return pH->EndFunction(); |
| 2186 | } |
| 2187 | |
| 2188 | ////////////////////////////////////////////////////////////////////////// |
| 2189 | int CScriptBind_Entity::SetAttachmentObject(IFunctionHandler* pH, int characterSlot, const char* attachmentName, ScriptHandle entityId, int slot, int flags) |
nothing calls this directly
no test coverage detected