From 464419db73a7489e2d7857d642ad6e66fa395dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Tue, 6 Mar 2018 17:33:33 +0100 Subject: [PATCH] SDK/EntityList: Fix movement --- SDK/include/NDK/EntityList.inl | 6 ++++++ 1 file changed, 6 insertions(+) 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;