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

Method SetAttachmentLight

Code/CryEngine/CryEntitySystem/ScriptBind_Entity.cpp:2278–2309  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2276
2277//////////////////////////////////////////////////////////////////////////
2278int 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
2311int CScriptBind_Entity::SetAttachmentPos(IFunctionHandler* pH, int characterSlot, const char* attachmentName, Vec3 pos)
2312{

Callers

nothing calls this directly

Calls 6

GetInterfaceByNameMethod · 0.80
AddBindingMethod · 0.80
GetCharacterMethod · 0.45
EndFunctionMethod · 0.45
LoadLightMethod · 0.45
HideAttachmentMethod · 0.45

Tested by

no test coverage detected