Fix new entity ID system (#39)

This commit is contained in:
Epix
2023-08-07 22:34:28 -07:00
committed by GitHub
parent 1b97875dd6
commit ef9df3f9de

View File

@@ -70,6 +70,7 @@ Entity::Entity(Level* pLevel)
Entity::~Entity()
{
releaseEntityId(m_EntityID);
}
void Entity::setLevel(Level* pLvl)
@@ -1082,6 +1083,8 @@ int Entity::allocateEntityId()
while (s_EntityIDs.find(id) != s_EntityIDs.end())
id++;
s_EntityIDs.insert(id);
return id;
}