mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
AddComponent<> now replaces instead of crashing if it already exists
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Nuake
|
||||
|
||||
template<typename T>
|
||||
T& AddComponent() {
|
||||
T& component = m_Scene->m_Registry.emplace<T>(m_EntityHandle);
|
||||
T& component = m_Scene->m_Registry.emplace_or_replace <T>(m_EntityHandle);
|
||||
return component;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user