Damage and Spashdamage working, phantomShapes not really working

This commit is contained in:
ViktorLjung
2014-05-27 07:04:29 +02:00
parent a0ee235473
commit c37df5c178
27 changed files with 804 additions and 202 deletions
+5 -4
View File
@@ -72,17 +72,18 @@ EntityID World::GetEntityBaseParent(EntityID entity)
bool World::ValidEntity(EntityID entity)
{
return m_EntityParents.find(entity) != m_EntityParents.end();
return m_EntityParents.find(entity) != m_EntityParents.end()
&& m_EntitiesToRemove.find(entity) == m_EntitiesToRemove.end();
}
void World::RemoveEntity(EntityID entity)
{
m_EntitiesToRemove.push_back(entity);
m_EntitiesToRemove.insert(entity);
for (auto pair : m_EntityParents)
{
if (pair.second == entity)
{
m_EntitiesToRemove.push_back(pair.first);
m_EntitiesToRemove.insert(pair.first);
}
}
}
@@ -102,7 +103,7 @@ void World::ProcessEntityRemovals()
for (auto pair : m_Systems)
{
auto system = pair.second;
system->OnComponentRemoved(type, component.get());
system->OnComponentRemoved(entity, type, component.get());
}
m_ComponentsOfType[type].remove(component);
}