"Proper" handling of conditional rendering of entities parented to camera or entities that should be hidden from the active local player perspective

This commit is contained in:
2016-01-27 11:36:24 +01:00
parent 505a6c7396
commit 8bed5194d8
11 changed files with 61 additions and 27 deletions
+6 -2
View File
@@ -54,8 +54,12 @@ ComponentWrapper World::AttachComponent(EntityID entity, const std::string& comp
bool World::HasComponent(EntityID entity, const std::string& componentType) const
{
ComponentPool* pool = m_ComponentPools.at(componentType);
return pool->KnowsEntity(entity);
auto it = m_ComponentPools.find(componentType);
if (it == m_ComponentPools.end()) {
return false;
} else {
return it->second->KnowsEntity(entity);
}
}
ComponentWrapper World::GetComponent(EntityID entity, const std::string& componentType)