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

Method GetEntityStorage

BG3Extender/GameDefinitions/EntitySystem.cpp:679–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677}
678
679EntityStorageData* EntityStorageContainer::GetEntityStorage(EntityHandle entityHandle) const
680{
681 if (entityHandle.GetThreadIndex() >= Salts.Buckets.size()) {
682 return nullptr;
683 }
684
685 auto& componentSalts = Salts.Buckets[entityHandle.GetThreadIndex()];
686 if (entityHandle.GetIndex() < componentSalts.size()) {
687 auto const& salt = componentSalts[entityHandle.GetIndex()];
688 if (salt.Salt == entityHandle.GetSalt()) {
689 return Entities[salt.EntityClassIndex];
690 }
691 }
692
693 return nullptr;
694}
695
696EntityStorageData* EntityWorld::GetEntityStorage(EntityHandle entityHandle) const
697{

Callers

nothing calls this directly

Calls 4

GetThreadIndexMethod · 0.80
sizeMethod · 0.45
GetIndexMethod · 0.45
GetSaltMethod · 0.45

Tested by

no test coverage detected