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

Method DestroyEntity

BG3Extender/GameDefinitions/EntitySystem.cpp:548–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548bool EntityCommandBuffer::DestroyEntity(EntityHandle entity)
549{
550 if (HandleGenerator->IsEntityAlive(entity)) {
551 auto change = Data.GetOrAddEntityChange(entity);
552 if ((change->Flags & EntityChangeFlags::Create) == EntityChangeFlags::Create) {
553 ERR("Cannot create and destroy an entity in the same frame");
554 } else {
555 change->Flags |= EntityChangeFlags::Destroy;
556 return true;
557 }
558 }
559
560 return false;
561}
562
563void* EntityCommandBuffer::GetComponentChange(ComponentTypeIndex type, ComponentFrameStorageIndex const& index) const
564{

Callers

nothing calls this directly

Calls 2

IsEntityAliveMethod · 0.80
GetOrAddEntityChangeMethod · 0.80

Tested by

no test coverage detected