This commit is contained in:
Confideo-IOM
2026-08-18 16:23:20 +01:00
parent 282243a16b
commit 20c0794d10
66 changed files with 622 additions and 1144 deletions
+5 -9
View File
@@ -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 */