Fixed weird behavior when components would register multiple times (Hint: It should never happen in the first place)

This commit is contained in:
2016-01-11 10:38:23 +01:00
parent 39dd27726d
commit e8e93587e9
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -53,7 +53,9 @@ void World::DeleteEntity(EntityID entity)
void World::RegisterComponent(ComponentInfo& ci)
{
m_ComponentPools[ci.Name] = new ComponentPool(ci);
if (m_ComponentPools.find(ci.Name) == m_ComponentPools.end()) {
m_ComponentPools[ci.Name] = new ComponentPool(ci);
}
}
ComponentWrapper World::AttachComponent(EntityID entity, std::string componentType)