diff --git a/SDK/include/NDK/EntityList.inl b/SDK/include/NDK/EntityList.inl index ce77c1238..4c99aef7a 100644 --- a/SDK/include/NDK/EntityList.inl +++ b/SDK/include/NDK/EntityList.inl @@ -180,6 +180,12 @@ namespace Ndk inline EntityList& EntityList::operator=(EntityList&& entityList) noexcept { + if (this == &entityList) + return *this; + + for (const Ndk::EntityHandle& entity : *this) + entity->UnregisterEntityList(this); + m_entityBits = std::move(entityList.m_entityBits); m_world = entityList.m_world;