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

Method IsValid

BG3Extender/GameDefinitions/EntitySystem.cpp:661–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661bool EntityWorld::IsValid(EntityHandle entityHandle) const
662{
663 if (entityHandle.GetThreadIndex() < std::size(HandleGenerator->ThreadStates)) {
664 auto& state = HandleGenerator->ThreadStates[entityHandle.GetThreadIndex()];
665 if (entityHandle.GetIndex() < state.Entries.size()) {
666 auto const& salt = state.Entries[entityHandle.GetIndex()];
667 return salt.Salt == entityHandle.GetSalt() && salt.Index == entityHandle.GetIndex();
668 }
669 }
670
671 return false;
672}
673
674EntityCommandBuffer* EntityWorld::Deferred()
675{

Callers 4

IsFixedStringRefMethod · 0.45
WrappedIsValidMethod · 0.45

Calls 4

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

Tested by

no test coverage detected