Skip to content

Commit

Permalink
20271: Fixes bugs when storing entities with many contained entities (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
howsohazard authored May 10, 2024
1 parent f649820 commit b74690d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/Amalgam/entity/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,29 @@ class Entity
: bufferReference(&buffer)
{ }

inline EntityReferenceBufferReference(EntityReferenceBufferReference &&erbr)
{
bufferReference = erbr.bufferReference;
erbr.bufferReference = nullptr;
}

inline ~EntityReferenceBufferReference()
{
bufferReference->clear();
if(bufferReference != nullptr)
bufferReference->clear();
}

inline EntityReferenceBufferReference &operator=(EntityReferenceBufferReference &&erbr)
{
if(this != &erbr)
{
if(bufferReference != nullptr)
bufferReference->clear();

bufferReference = erbr.bufferReference;
erbr.bufferReference = nullptr;
}
return *this;
}

constexpr operator std::vector<EntityReferenceType> *()
Expand Down

0 comments on commit b74690d

Please sign in to comment.