Cleanup
This commit is contained in:
@@ -28,7 +28,10 @@ class HydraComponentArray : public IHydraComponentArray
|
||||
void RemoveComponent(HydraID entity_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
assert(m_entity_to_component.find(entity_id) == m_entity_to_component.end() && "Trying to remove a component that doesnt exist");
|
||||
if(m_entity_to_component.find(entity_id) == m_entity_to_component.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HydraID component_index = m_entity_to_component[entity_id];
|
||||
HydraID last_component_index = m_component_count -1;
|
||||
@@ -80,15 +83,8 @@ class HydraComponentArray : public IHydraComponentArray
|
||||
|
||||
void EntityDeleted(HydraID entity_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if(m_entity_to_component.find(entity_id) != m_entity_to_component.end())
|
||||
{
|
||||
RemoveComponent(entity_id);
|
||||
}
|
||||
RemoveComponent(entity_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* HYDRACOMPONENTARRAY */
|
||||
|
||||
Reference in New Issue
Block a user