MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / ResetAttachment

Method ResetAttachment

Code/CryEngine/CryEntitySystem/ScriptBind_Entity.cpp:2139–2159  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2137
2138//////////////////////////////////////////////////////////////////////////
2139int CScriptBind_Entity::ResetAttachment(IFunctionHandler* pH, int characterSlot, const char* attachmentName)
2140{
2141 GET_ENTITY;
2142
2143 ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot);
2144
2145 if (!pCharacter)
2146 {
2147 return pH->EndFunction();
2148 }
2149
2150 IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager();
2151 IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName);
2152
2153 if (pIAttachment)
2154 {
2155 pIAttachment->ClearBinding();
2156 }
2157
2158 return pH->EndFunction();
2159}
2160
2161int CScriptBind_Entity::SetAttachmentEffect(IFunctionHandler* pH, int characterSlot, const char* attachmentName, const char* effectName, Vec3 offset, Vec3 dir, float scale, int flags)
2162{

Callers

nothing calls this directly

Calls 4

GetInterfaceByNameMethod · 0.80
ClearBindingMethod · 0.80
GetCharacterMethod · 0.45
EndFunctionMethod · 0.45

Tested by

no test coverage detected