MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetRawComponent

Method GetRawComponent

BG3Extender/GameDefinitions/EntitySystem.cpp:609–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609void* EntityWorld::GetRawComponent(EntityHandle entityHandle, ComponentTypeIndex type, std::size_t componentSize, bool isProxy)
610{
611 auto storage = GetEntityStorage(entityHandle);
612 if (IsOneFrame(type)) {
613 if (storage != nullptr) {
614 return storage->GetOneFrameComponent(entityHandle, type);
615 }
616 } else {
617 if (storage != nullptr) {
618 auto component = storage->GetComponent(entityHandle, type, componentSize, isProxy);
619 if (component != nullptr) {
620 return component;
621 }
622 }
623
624 auto change = Cache->WriteChanges.GetChange(entityHandle, type);
625 if (change != nullptr) {
626 return change;
627 }
628
629 change = Cache->ReadChanges.GetChange(entityHandle, type);
630 if (change != nullptr) {
631 return change;
632 }
633 }
634
635 return nullptr;
636}
637
638bool EntityWorld::MarkComponentAsChanged(EntityHandle entity, ComponentTypeIndex component)
639{

Callers 2

RemoveComponentMethod · 0.80
PrepareAddComponentMethod · 0.80

Calls 5

IsOneFrameFunction · 0.85
GetEntityWorldFunction · 0.85
GetOneFrameComponentMethod · 0.80
GetChangeMethod · 0.80
GetComponentMethod · 0.45

Tested by

no test coverage detected